09.09.2018, 11:32
Quote:
No, it is not. It does not make sense to store per-player array just for 1 second until they get kicked? What is the purpose?
Local variable "id" is just fine, it does what it has to do and that's all you need. There is one (main) thread so they cannot be executed at the same time. After the code execution is finished, it is deleted and when another player types the command, it creates a new variable again. No conflicts. |
Quote:
Код:
CMD:kick(playerid, params[]) // params is a string. { new id; // you missed an extra bracket after 'id' if(sscanf(params, "u", id)) return scm(playerid, COLOR_USAGE, "USAGE:/kick [id]"); if(id == INVALID_PLAYER_ID) return scm(playerid, COLOR_ERROR, "invalid id"); Kick(id); return 1; } |
