Scripting help needed -
Lunixx - 13.10.2013
Can anyone script me command for NGG script Cops.
Command is /c20 [id] and it works like this, it traces suspects with checkpoints like is shown in this video:
[ame]http://www.youtube.com/watch?v=_eD8nVXMNVo[/ame]
Please help me
Re: Scripting help needed -
tyler12 - 13.10.2013
pawn Код:
forward TrackTimer(playerid);
new pTrack[MAX_PLAYERS] = {INVALID_PLAYER_ID,...},pTrackTimer[MAX_PLAYERS];
CMD:c20(playerid,params[])
{
switch(pTrack[playerid]])
{
case INVALID_PLAYER_ID:
{
new id;
if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"/c20 [playerid]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Invalid playerid");
pTrack[playerid] = id;
pTrackTimer[playerid] = SetTimerEx("TrackTimer",1000,1,"i",playerid);
}
default
{
pTrack[playerid] = INVALID_PLAYER_ID;
KillTimer(pTrackTimer[playerid]);
DisablePlayerCheckpoint(playerid);
}
}
return 1;
}
public TrackTimer(playerid)
{
new Float:pos[3];
GetPlayerPos(pTrack[playerid],pos[0],pos[1],pos[2]);
SetPlayerCheckpoint(playerid,pos[0],pos[1],pos[2],4.0);
return 1;
}
Re: Scripting help needed -
Lunixx - 13.10.2013
Thanks
Re: Scripting help needed -
Lunixx - 13.10.2013
C:\Documents and Settings\LinesX\Desktop\PZG\PZG\gamemodes\PZG.pwn( 68575) : error 001: expected token: ")", but found "]"
C:\Documents and Settings\LinesX\Desktop\PZG\PZG\gamemodes\PZG.pwn( 68575) : error 029: invalid expression, assumed zero
C:\Documents and Settings\LinesX\Desktop\PZG\PZG\gamemodes\PZG.pwn( 68577) : error 014: invalid statement; not in switch
C:\Documents and Settings\LinesX\Desktop\PZG\PZG\gamemodes\PZG.pwn( 68577) : warning 215: expression has no effect
C:\Documents and Settings\LinesX\Desktop\PZG\PZG\gamemodes\PZG.pwn( 68577) : error 001: expected token: ";", but found ":"
C:\Documents and Settings\LinesX\Desktop\PZG\PZG\gamemodes\PZG.pwn( 68577) : error 029: invalid expression, assumed zero
C:\Documents and Settings\LinesX\Desktop\PZG\PZG\gamemodes\PZG.pwn( 68577) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Re: Scripting help needed -
Konstantinos - 13.10.2013
pawn Код:
switch(pTrack[playerid]])
Typing mistake. Change to:
Re: Scripting help needed -
iZN - 13.10.2013
Solved above.