FreezePlayer for wait loading object HELP
#1

help guys

pawn Код:
dcmd_island(playerid,params[])
{
    #pragma unused params
    SetPlayerPos(playerid, 829.37,-2432.32,1.80);
    SetPlayerInterior(playerid,0);
    SetTimer(FreezePlayer,5000);
    TogglePlayerControllable(playerid,0);
    GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~g~Wellcome tot ~w~/island",2000,3);
    SendClientMessageToAll(0x00FF00FF, "Come Join Us too use commands: /island");
    GameTextForPlayer(playerid,"WELCOME TO ISLAND",4000,5);
    return 1;
}
forward FreezePlayer();
public FreezePlayer()
{
    GameTextForPlayer(playerid,"wait loading object",5000,5);
    TogglePlayerControllable(playerid,1);
    return 1;
}


when compile:

Код:
C:\Documents and Settings\user\Desktop\SAMP SERVER 0.3c\gamemodes\[GM]Clan.pwn(2631) : error 076: syntax error in the expression, or invalid function call
C:\Documents and Settings\user\Desktop\SAMP SERVER 0.3c\gamemodes\[GM]Clan.pwn(2641) : error 017: undefined symbol "playerid"
C:\Documents and Settings\user\Desktop\SAMP SERVER 0.3c\gamemodes\[GM]Clan.pwn(2642) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#2

First of all a timer starts x milliseconds AFTER you have executed it;
Your code will freeze the player 5 seconds AFTER he was teleported, not for five seconds when he is teleported.

So what you do is, to freeze the player FIRST then run a timer to UNFREEZE the player.
pawn Код:
// In the command;
GameTextForPlayer(playerid,"wait loading object",5000,5);
TogglePlayerControllable(playerid,0);
SetTimerEx("UnFreezePlayer",5000,0,"i",playerid);
// And

forward UnFreezePlayer(playerid);
public UnFreezePlayer(playerid)
{
    TogglePlayerControllable(playerid,1);
}
EDIT: Edited a few times, now it is the final solution.
Reply
#3

Yes,as ****** said,you have to use it as a string.
But i truelly suggest you to use this instead of simple timer:
pawn Код:
SetTimerEx("FreezePlayer",5000,false,"i",playerid);
EDIT:Wrong,i didn't see the post above sorry.
Reply
#4

yes problem solved. Big thanks all guys ..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)