|
Originally Posted by L30
/example was just a example command, its with all the commands the require a ID
|
|
Originally Posted by L30
/example was just a example command, its with all the commands the require a ID
|
if(strcmp(cmd, "/hp", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "/hp [playerid/PartOfName] [health]");
return 1;
}
new health;
health = strval(tmp);
if(IsPlayerConnected(playerid))
{
if(playerid != INVALID_PLAYER_ID)
{
SetPlayerHealth(playerid, health);
}
}
}
return 1;
}
|
Originally Posted by L30
Код:
if(strcmp(cmd, "/hp", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "/hp [playerid/PartOfName] [health]");
return 1;
}
new health;
health = strval(tmp);
if(IsPlayerConnected(playerid))
{
if(playerid != INVALID_PLAYER_ID)
{
SetPlayerHealth(playerid, health);
}
}
}
return 1;
}
|
if(strcmp(cmd, "/hp", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "/hp [playerid/PartOfName] [health]");
return 1;
}
new targetid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "/hp [playerid/PartOfName] [health]");
return 1;
}
new health = strval(tmp);
if(IsPlayerConnected(targetid))
{
SetPlayerHealth(playerid, health);
}
return 1;
}
targetid = ReturnUser(tmp);