OKStyle
| Дата: Пятница, 10/07/2009, 01:15 | Сообщение # 1 |
Analgésico
Регистрация: 17/01/2009 |
Клан: | [ACF] |
Статус: | |
| Code #include <a_samp> #include <uf> new Text:Textdraw0[MAX_PLAYERS]; forward CheckVehicle2(playerid); new Vehicle[MAX_PLAYERS]; new Float:Speed2[MAX_PLAYERS]; new Float:Half[MAX_PLAYERS]; new vehicle[MAX_PLAYERS]; new Float:vHealth[MAX_PLAYERS]; new Stringy[256]; main() { print("\n----------------------------------"); print(" Vehicle System by Backwardsman97\n"); print("----------------------------------\n"); } public OnFilterScriptInit() { GameModeInit(); return 1; } public OnPlayerConnect(playerid) { Textdraw0[playerid] = TextDrawCreate(83.000000,301.000000,"Vehicle Speed ~n~ 0 Mph ~n~ Vehicle Health ~n~ ||||||||||"); TextDrawUseBox(Textdraw0[playerid],1); TextDrawBoxColor(Textdraw0[playerid],0x00000066); TextDrawTextSize(Textdraw0[playerid],-23.000000,110.000000); TextDrawAlignment(Textdraw0[playerid],2); TextDrawBackgroundColor(Textdraw0[playerid],0x000000ff); TextDrawFont(Textdraw0[playerid],3); TextDrawLetterSize(Textdraw0[playerid],0.399999,1.000000); TextDrawColor(Textdraw0[playerid],0xffffffff); TextDrawSetOutline(Textdraw0[playerid],1); TextDrawSetProportional(Textdraw0[playerid],1); TextDrawSetShadow(Textdraw0[playerid],1); return 1; } public OnPlayerDisconnect(playerid) { TextDrawDestroy(Textdraw0[playerid]); return 1; } public OnPlayerDeath(playerid) { TextDrawHideForPlayer(playerid,Text:Textdraw0[playerid]); KillTimer(Vehicle[playerid]); return 1; } public OnPlayerStateChange(playerid,newstate,oldstate) { if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) { TextDrawShowForPlayer(playerid,Text:Textdraw0[playerid]); Vehicle[playerid] = SetTimerEx("CheckVehicle2",500,true,"i",playerid); return 1; } if(newstate == PLAYER_STATE_ONFOOT) { TextDrawHideForPlayer(playerid,Text:Textdraw0[playerid]); KillTimer(Vehicle[playerid]); return 1; } return 1; } public CheckVehicle2(playerid) { if(IsPlayerInAnyVehicle(playerid)) { Speed2[playerid] = GetPlayerSpeed(playerid,SPEED_MPH); Half[playerid] = Speed2[playerid]/2; vehicle[playerid] = GetPlayerVehicleID(playerid); GetVehicleHealth(vehicle[playerid], vHealth[playerid]); if(vHealth[playerid] >= 900) { format(Stringy,sizeof(Stringy),"Vehicle Speed ~n~ %0.0f Mph ~n~ Vehicle Health ~n~ ||||||||||",Half[playerid]); TextDrawSetString(Text:Textdraw0[playerid],Stringy); return 1; } if(vHealth[playerid] >= 800 && vHealth[playerid] < 900) { format(Stringy,sizeof(Stringy),"Vehicle Speed ~n~ %0.0f Mph ~n~ Vehicle Health ~n~ |||||||||",Half[playerid]); TextDrawSetString(Text:Textdraw0[playerid],Stringy); return 1; } if(vHealth[playerid] >= 700 && vHealth[playerid] < 800) { format(Stringy,sizeof(Stringy),"Vehicle Speed ~n~ %0.0f Mph ~n~ Vehicle Health ~n~ ||||||||",Half[playerid]); TextDrawSetString(Text:Textdraw0[playerid],Stringy); return 1; } if(vHealth[playerid] >= 600 && vHealth[playerid] < 700) { format(Stringy,sizeof(Stringy),"Vehicle Speed ~n~ %0.0f Mph ~n~ Vehicle Health ~n~ |||||||",Half[playerid]); TextDrawSetString(Text:Textdraw0[playerid],Stringy); return 1; } if(vHealth[playerid] >= 500 && vHealth[playerid] < 600) { format(Stringy,sizeof(Stringy),"Vehicle Speed ~n~ %0.0f Mph ~n~ Vehicle Health ~n~ ||||||",Half[playerid]); TextDrawSetString(Text:Textdraw0[playerid],Stringy); return 1; } if(vHealth[playerid] >= 400 && vHealth[playerid] < 500) { format(Stringy,sizeof(Stringy),"Vehicle Speed ~n~ %0.0f Mph ~n~ Vehicle Health ~n~ |||||",Half[playerid]); TextDrawSetString(Text:Textdraw0[playerid],Stringy); return 1; } if(vHealth[playerid] >= 300 && vHealth[playerid] < 400) { format(Stringy,sizeof(Stringy),"Vehicle Speed ~n~ %0.0f Mph ~n~ Vehicle Health ~n~ ||||",Half[playerid]); TextDrawSetString(Text:Textdraw0[playerid],Stringy); return 1; } if(vHealth[playerid] >= 200 && vHealth[playerid] < 300) { format(Stringy,sizeof(Stringy),"Vehicle Speed ~n~ %0.0f Mph ~n~ Vehicle Health ~n~ |||",Half[playerid]); TextDrawSetString(Text:Textdraw0[playerid],Stringy); return 1; } if(vHealth[playerid] >= 100 && vHealth[playerid] < 200) { format(Stringy,sizeof(Stringy),"Vehicle Speed ~n~ %0.0f Mph ~n~ Vehicle Health ~n~ ||",Half[playerid]); TextDrawSetString(Text:Textdraw0[playerid],Stringy); return 1; } if(vHealth[playerid] >= 0 && vHealth[playerid] < 100) { format(Stringy,sizeof(Stringy),"Vehicle Speed ~n~ %0.0f Mph ~n~ Vehicle Health ~n~ |",Half[playerid]); TextDrawSetString(Text:Textdraw0[playerid],Stringy); return 1; } } return 1; } Автор: Backwardsman97.
|
|
| |