Weird timer-parameter
#5

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:

Код:
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;
}
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"
Reply


Messages In This Thread
Weird timer-parameter - by eSPeZet - 06.08.2017, 01:24
Re: Weird timer-parameter - by NewFreeroamStunt - 06.08.2017, 01:41
Re: Weird timer-parameter - by eSPeZet - 06.08.2017, 01:53
Re: Weird timer-parameter - by ISmokezU - 06.08.2017, 02:31
Re: Weird timer-parameter - by eSPeZet - 06.08.2017, 02:38
Re: Weird timer-parameter - by eSPeZet - 06.08.2017, 21:18
Re: Weird timer-parameter - by Misiur - 06.08.2017, 21:22
Re: Weird timer-parameter - by Misiur - 06.08.2017, 21:27
Respuesta: Weird timer-parameter - by ThiagoMikael - 06.08.2017, 21:28
Re: Weird timer-parameter - by eSPeZet - 06.08.2017, 21:33
Re: Weird timer-parameter - by Kane - 06.08.2017, 21:51
Re: Weird timer-parameter - by Misiur - 06.08.2017, 21:53
Re: Weird timer-parameter - by Nehe - 06.08.2017, 21:53
Re: Weird timer-parameter - by eSPeZet - 06.08.2017, 21:57
Re: Weird timer-parameter - by BlackBank - 06.08.2017, 23:46
Re: Weird timer-parameter - by eSPeZet - 07.08.2017, 01:43

Forum Jump:


Users browsing this thread: 2 Guest(s)