07.06.2020, 15:07
PHP Code:
if(strcmp(cmd, "/hd", true) == 0)
{
new Float:Vida, Float:Colete;
new S[128];
Vida = GetPlayerHealth(playerid);// armazena vida na variavel Vida
Colete = GetPlayerArmour(playerid);// armazena colete na variavel Colete
format(S, sizeof(S), "* O Jogador %s se rendeu, Vida:[%f] Colete[%f]!", PlayerName(playerid), Vida, Colete);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
UsandoAnimacao[playerid] = 1;
new Float:pPos[3];
GetPlayerPos(playerid,pPos[0],pPos[1], pPos[2]);
for(new p; p < GetMaxPlayers(); p++)
{
if(IsPlayerInRangeOfPoint(p,30.0,pPos[0], pPos[1], pPos[2]))
{
SendClientMessage(p, Vermelho, S);
}
}
return 1;
}
Dica, caso queira aprender mais sobre parвmetros em comandos, procure por 'STRTOK' ou use 'SSCANF'