11.11.2017, 12:29
Quote:
Basically, if an array of size "N" is passed, this code will return the first N-1 results. If there are less than "N" players whose name matches the given name then that many players will be returned and the next slot will be "INVALID_PLAYER_ID" to indicate the end of the list |
Let's take this basic command with freeze a player. If two players have the same first name, only the lower ID will get 'detected'.
PHP код:
CMD:test_freeze(playerid, params[])
{
extract params -> new player:targetid; else return Usage(playerid, "/freeze [name/id]");
CheckIsValidPlayer(targetid); // isplayerconnected + isplayernpc
TogglePlayerControllableEx(targetid, 0);
return 1;
}