Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Health , Ime i Pancir by FarkiAS :D
- ----------------------------------*/
- //------------------------------------------>>>>
- // INCLUDE
- //------------------------------------------>>>>
- #include <a_samp>
- #include <zcmd>
- #define PLAYERS 100
- //------------------------------------------>>>>
- // NEWS
- //------------------------------------------>>>>
- new Text:ImeIgraca;
- new Text:Health;
- new Text:Pancir;
- new strt[256];
- new Float:AR;
- new Float:health;
- //------------------------------------------>>>>
- // FORWARD
- //------------------------------------------>>>>
- forward prvojerahealtha();
- //------------------------------------------>>>>
- // PUBLIC
- //------------------------------------------>>>>
- public OnPlayerConnect(playerid)
- {
- ImeIgraca = TextDrawCreate(1.000000, 328.000000," ");
- TextDrawBackgroundColor(ImeIgraca, 255);
- TextDrawFont(ImeIgraca, 2);
- TextDrawLetterSize(ImeIgraca, 0.500000, 1.000000);
- TextDrawColor(ImeIgraca, -16776961);
- TextDrawSetOutline(ImeIgraca, 1);
- TextDrawSetProportional(ImeIgraca, 1);
- Health = TextDrawCreate(1.000000, 311.000000, " ");
- TextDrawBackgroundColor(Health, 255);
- TextDrawFont(Health, 2);
- TextDrawLetterSize(Health, 0.500000, 1.000000);
- TextDrawColor(Health, -16776961);
- TextDrawSetOutline(Health, 1);
- TextDrawSetProportional(Health, 1);
- Pancir = TextDrawCreate(1.000000, 294.000000, " ");
- TextDrawBackgroundColor(Pancir, 255);
- TextDrawFont(Pancir, 2);
- TextDrawLetterSize(Pancir, 0.500000, 1.000000);
- TextDrawColor(Pancir, -16776961);
- TextDrawSetOutline(Pancir, 1);
- TextDrawSetProportional(Pancir, 1);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetTimer("prvojerahealtha", 1000, 1);
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- TextDrawHideForAll(ImeIgraca);
- TextDrawHideForAll(Health);
- TextDrawHideForAll(Pancir);
- return 1;
- }
- public prvojerahealtha()
- {
- for(new i=0; i<PLAYERS; i++)
- {
- GetPlayerHealth(i, health);
- GetPlayerArmour(i, AR);
- format(strt,sizeof(strt),"HP: ~w~%.1f",health);
- TextDrawSetString(Health,strt);
- format(strt,sizeof(strt),"Pancir: ~w~%0.1f",AR);
- TextDrawSetString(Pancir,strt);
- }
- return 0;
- }
- //------------------------------------------>>>>
- // COMMANDS
- //------------------------------------------>>>>
- CMD:tdon(playerid,params[])
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerHealth(playerid, health);
- GetPlayerName(playerid,name,sizeof(name));
- GetPlayerArmour(playerid, AR);
- format(strt,sizeof(strt),"Ime igraca: ~w~%s",name);
- TextDrawSetString(ImeIgraca,strt);
- format(strt,sizeof(strt),"HP: ~w~%.1f",health);
- TextDrawSetString(Health,strt);
- format(strt,sizeof(strt),"Pancir: ~w~%0.1f",AR);
- TextDrawSetString(Pancir,strt);
- TextDrawShowForPlayer(playerid,ImeIgraca);
- TextDrawShowForPlayer(playerid,Health);
- TextDrawShowForPlayer(playerid,Pancir);
- return 1;
- }
- CMD:tdoff(playerid,params[])
- {
- TextDrawHideForPlayer(playerid,ImeIgraca);
- TextDrawHideForPlayer(playerid,Health);
- TextDrawHideForPlayer(playerid,Pancir);
- return 1;
- }
- //-------------------------------------------------->>>>
- // KRAJ SKRIPTE :)
- //---------------------------------------------------->>>>
Advertisement
Add Comment
Please, Sign In to add comment