THE CREW
Doriți să reacționați la acest mesaj? Creați un cont în câteva clickuri sau conectați-vă pentru a continua.

THE CREWConectare

THE CREW


description[Tutorial/SA:MP] Comanda /checkhp Empty[Tutorial/SA:MP] Comanda /checkhp

more_horiz



if (strcmp(cmd, "/checkhp", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /checkhp [playerid/PartOfName]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new Float:health;
new Float:armour;
GetPlayerHealth(giveplayerid, health);
GetPlayerArmour(giveplayerid, armour);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string,255,"*Name %s | HP: %.2f | Armour: %.2f",giveplayer,health,armour);
SendClientMessage(playerid,0xFFFFFFAA,string);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " That player is Offline !");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not a admin/helper to use that command!");
}
}
return 1;
}


Edited by k3nw00d_kri5ty, 02 July 2010 - 03:50 PM.

..
--------------------------------------------------------------------------------



#2 TwO



Sind rassistische

Members

474 posts
:


Posted 02 July 2010 - 04:58 PM

if (strcmp(cmd, "/checkhp", true) == 0) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /checkhp [playerid/PartOfName]"); return 1; } //giveplayerid = strval(tmp); giveplayerid = ReturnUser(tmp); GetPlayerName(giveplayerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* Check Health For: [ %s ]", sendername); SendClientMessage(playerid, COLOR_YELLOW, string); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { new Float:health; new Float:armour; GetPlayerHealth(giveplayerid, health); GetPlayerArmour(giveplayerid, armour); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string,255,"* %s | Hp: %.2f | Armour: %.2f", giveplayer, health, armour); SendClientMessage(playerid,0xFFFFFFAA,string); } } else { SendClientMessage(playerid, COLOR_GRAD1, " That player is Offline !"); } } else { SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command !"); } } return 1; }
Am aranjato eu "ochiometric" fara sa apara warnings in GameMod.
|| PlayerInfo[playerid][pHelper] >= 1) - asta numai in cazul in care serverul are definit Helper , cei care nu aveti helpers pe server stergeti || PlayerInfo[playerid][pHelper] >= 1).

Stare : Functionabila
Erori : 0
Warnings : 0

description[Tutorial/SA:MP] Comanda /checkhp EmptyRe: [Tutorial/SA:MP] Comanda /checkhp

more_horiz
Mersi mane si tu faci o treaba buna
privacy_tip Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum
power_settings_newConectați-vă pentru a răspunde