11.04.2017, 13:27
Why do you use this
if you have this
PHP код:
if(sscanf(params, "d", id))
{
if (health1==0.0)
{
SetPlayerHealth(playerid, 100.0);
return SendClientMessage(playerid,0x00FF00AA, "Back to mortality.");
}
if (health1>0.0)
{
SetPlayerHealth(playerid, FLOAT_INFINITY);
return SendClientMessage(playerid, 0x00FF00AA, "You are god now!");
}
}
PHP код:
if(IsPlayerConnected(id))
{
GetPlayerName(playerid, admin, MAX_PLAYER_NAME);
GetPlayerName(id, p, MAX_PLAYER_NAME);
GetPlayerHealth(id, health2);
if (health2>0.0)
{
SetPlayerHealth(id, FLOAT_INFINITY);
format(str2, sizeof(str2), "You have successfully turned %s into god.", p);
SendClientMessage(playerid, 0x00FF00AA, str2);
format(str1, sizeof(str1), "Admin %s has turned you into god!", admin);
SendClientMessage(id, 0x00FF00AA, str1);
}
if (health2==0)
{
SetPlayerHealth(id, 100.0);
format(str2, sizeof(str2), "You have turned god %s into human.", p);
SendClientMessage(playerid, 0x00FF00AA, str2);
return SendClientMessage(id, 0x00FF00AA, "Back to mortality.");
}
}
else SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player is not connected.");
return 1;