1
mIRC/pawn Scripting / One more help plz
« on: April 18, 2012, 11:12:51 am »
i made a cmd which cops can use but i have one error
if any cop use /c suspect he can suspect any criminal
i made one thing in this that cop can't suspect any other cop so i get 1 error plz help me
i add this at the top of the script
[pawn]new Cop[MAX_PLAYERS];
new Criminal[MAX_PLAYERS];[/pawn]
i add this in onplayerspawn
[pawn] if(classid == 1 || classid == 2 || classid == 3 || classid == 4 || classid == 98 || classid == 100 || classid == 102 || classid == 103) {
SendClientMessage(playerid,COLOR_YELLOW,"*** You have spawned as a law enforcement person.");
Cop[playerid] = 1;
}
if(classid == 27 || classid == 29 || classid == 30 || classid == 46 || classid == 51 || classid == 87 || classid == 85 || classid == 149) {
SendClientMessage(playerid,COLOR_YELLOW,"*** You have spawned as a criminal.");
Criminal[playerid] = 1;
}[/pawn]
i add this in playerdisconnect
[pawn] Cop[playerid] = 0;
Criminal[playerid] = 0;[/pawn]
i add this in playerdeath
[pawn] Cop[playerid] = 0;
Criminal[playerid] = 0;[/pawn]
i add this ccmd at the down side of " drown " cmd
[pawn] else if(strcmp(cmd,"suspect",true) == 0 || strcmp(cmd,"sus",true) == 0) {
new szMsg[256], plr;
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if(Cop[playerid] == 1)
if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c suspect [Nick/ID] or /c sus [Nick/ID]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else if (plr == classid == 1) SendClientMessage(playerid,COLOR_RED,"Error: He is not criminal");
{
TogglePlayerControllable(playerid,1);
SetPlayerPos(playerid, 387.0193,-510.2893,9.3956 );
SetTimer("playersuspect",9999,0);
}
return 1;
}[/pawn]
i add this at down side of the script:
[pawn]public playersuspect(playerid)
{
TogglePlayerControllable(playerid, 0 );
SetPlayerPos(playerid, 399.5581,-468.9074,11.7367);
SendClientMessage(playerid, COLOR_GREEN,"You are now un suspect");
SendClientMessage(playerid, COLOR_GREEN,"Now go and kill the cops");
}[/pawn]
i get this 1 error:
plz help me
if any cop use /c suspect he can suspect any criminal
i made one thing in this that cop can't suspect any other cop so i get 1 error plz help me
i add this at the top of the script
[pawn]new Cop[MAX_PLAYERS];
new Criminal[MAX_PLAYERS];[/pawn]
i add this in onplayerspawn
[pawn] if(classid == 1 || classid == 2 || classid == 3 || classid == 4 || classid == 98 || classid == 100 || classid == 102 || classid == 103) {
SendClientMessage(playerid,COLOR_YELLOW,"*** You have spawned as a law enforcement person.");
Cop[playerid] = 1;
}
if(classid == 27 || classid == 29 || classid == 30 || classid == 46 || classid == 51 || classid == 87 || classid == 85 || classid == 149) {
SendClientMessage(playerid,COLOR_YELLOW,"*** You have spawned as a criminal.");
Criminal[playerid] = 1;
}[/pawn]
i add this in playerdisconnect
[pawn] Cop[playerid] = 0;
Criminal[playerid] = 0;[/pawn]
i add this in playerdeath
[pawn] Cop[playerid] = 0;
Criminal[playerid] = 0;[/pawn]
i add this ccmd at the down side of " drown " cmd
[pawn] else if(strcmp(cmd,"suspect",true) == 0 || strcmp(cmd,"sus",true) == 0) {
new szMsg[256], plr;
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if(Cop[playerid] == 1)
if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c suspect [Nick/ID] or /c sus [Nick/ID]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else if (plr == classid == 1) SendClientMessage(playerid,COLOR_RED,"Error: He is not criminal");
{
TogglePlayerControllable(playerid,1);
SetPlayerPos(playerid, 387.0193,-510.2893,9.3956 );
SetTimer("playersuspect",9999,0);
}
return 1;
}[/pawn]
i add this at down side of the script:
[pawn]public playersuspect(playerid)
{
TogglePlayerControllable(playerid, 0 );
SetPlayerPos(playerid, 399.5581,-468.9074,11.7367);
SendClientMessage(playerid, COLOR_GREEN,"You are now un suspect");
SendClientMessage(playerid, COLOR_GREEN,"Now go and kill the cops");
}[/pawn]
i get this 1 error:
Quote
D:\MANSOOR FILES 8-)\Games\GTA Vice City\Vice City Mp\VC-MP SERVERS\Copy of VCMP SERVER\gamemodes\Untitled.pwn(1984) : error 017: undefined symbol "classid"
plz help me