06.08.2017, 02:38
(
Последний раз редактировалось eSPeZet; 06.08.2017 в 21:36.
)
The funny thing is that this does NOT happen..
if I replace pid with playerid it still kicks the ID i typed to kick..
and even if i replace pid with SOMETHING RANDOM it still works.. that is what I'm trying to say the whole time
Idk maybe my expressions are weird or something... but what I am trying to say is, that THIS would totally WORK for me:
I thought maybe its cause of the SetTimerEx function, but even when i replace it with SetTimer it is the same..don't get me wrong, my command WORKS the way i wanted it to work, but it's just weird that I can use any parameter I want and it RECOGNIZES it as "pid" even when i don't type pid..
And I want to know WHY and how to change it to "normal behavior"
if I replace pid with playerid it still kicks the ID i typed to kick..
and even if i replace pid with SOMETHING RANDOM it still works.. that is what I'm trying to say the whole time
Idk maybe my expressions are weird or something... but what I am trying to say is, that THIS would totally WORK for me:
Код:
dcmd_kick(playerid, params[]) { if(IsPlayerAdmin(playerid)) { new pid, reason[128], name[MAX_PLAYER_NAME], done[128]; if(sscanf(params, "uz", pid, reason)) { SendClientMessage(playerid, rot, "ERROR: /kick [ID/Name] [Grund]"); } if(pid == INVALID_PLAYER_ID) { SendClientMessage(playerid, rot, "ERROR: Spieler ist nicht online."); } else if(pid == playerid) { SendClientMessage(playerid, rot, "Du kannst dich nicht selbst kicken."); } else { GetPlayerName(pid, name, sizeof(name)); format(done, sizeof(done), "%s wurde gekickt. Grund: %s", name, reason); SendClientMessage(playerid, rot, done); SetTimer("KickTimer", 500, false); } } else { SendClientMessage(playerid, rot, "Error: Du bist kein Admin!"); } return 1; } forward KickTimer(SOMETHINGRANDOM); public KickTimer(SOMETHINGRANDOM) { Kick(SOMETHINGRANDOM); return 1; }
And I want to know WHY and how to change it to "normal behavior"