Need a little help with scripting a function
#3

Quote:
Originally Posted by еddy
You'll need a timer, and the TogglePlayerControllable.

wiki.sa-mp.com/wiki/SetTimer
wiki.sa-mp.com/wiki/SetTimerEx
wiki.sa-mp.com/wiki/KillTimer
wiki.sa-mp.com/TogglePlayerControllable




Dude, you are lucky because I had nothing to do, and then I did it for you. Here you go:

pawn Код:
#include <a_samp>

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/teleport", cmdtext, true, 0) == 0)
{
SetPlayerPos(playerid, Float:X, Float:Y, Float:Z);
TogglePlayerControllable(playerid, false);
SetTimer("Timer",2000,0);
return 1;
}
return 0;
}

forward Timer(playerid);
public Timer(playerid)
{
TogglePlayerControllable(playerid, true);
return 0;
}
But take a look at it, don't just copy and paste it... Otherwise you won't learn anything!
Thanks Eddy, but I already did it by reading on the webside you sent me, thank you anyway
Reply


Messages In This Thread
Need a little help with scripting a function - by tomnidi - 08.07.2009, 19:53
Re: Need a little help with scripting a function - by refshal - 08.07.2009, 19:57
Re: Need a little help with scripting a function - by tomnidi - 08.07.2009, 20:15

Forum Jump:


Users browsing this thread: 1 Guest(s)