SA-MP Forums Archive
3 Errors - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 3 Errors (/showthread.php?tid=161064)



/swat - iLcke - 18.07.2010

EDIT:
Код:
if(strcmp(cmd, "/swat", true) == 0)
{
new skin = PlayerInfo[playerid][pModel];
GetPlayerName(playerid, sendername, sizeof(sendername));
if (PlayerToPoint(300, playerid, 314.8210,-141.4320,999.6016))
{
if(PlayerInfo[playerid][pService] == 11 && pduty[playerid] == 1)
{
gTeam[playerid] = 3;
SetPlayerToTeamColor(playerid);
format(string, sizeof(string), "**[SWAT] %s has gone off duty", sendername);
SendTeamMessage(2, TEAM_BLUE_COLOR, string);
ResetPlayerWeapons(playerid);
SetPlayerSkin(playerid, skin);
pduty[playerid] == 0;
printf("%s", string);
return 1;
}
if(PlayerInfo[playerid][pService] == 11 && pduty[playerid] == 0)
{
gTeam[playerid] = 2;
SetPlayerToTeamColor(playerid);
format(string, sizeof(string), "**[SWAT] %s has gone on duty", sendername);
SendTeamMessage(2, TEAM_BLUE_COLOR, string);
SetPlayerSkin(playerid, 285);
pduty[playerid] == 1;
return 1;
}
SendClientMessage(playerid, COLOR_GRAD2, " you are not in the PD armoury!");
return 1;
}
}
Alright, so, if there pduty is set to 1. it makes them off duty, if its 0, it makes them on duty, ideas?


Re: 3 Errors - Kitten - 18.07.2010

Код:
if(PlayerInfo[playerid][pService] == 11)
else if(PlayerInfo[playerid][pService] == 11 && pduty == 1)
else if(PlayerInfo[playerid][pService] == 11 && pduty == 0)

or

if(PlayerInfo[playerid][pService] == 11);
else if(PlayerInfo[playerid][pService] == 11 && pduty == 1);
else if(PlayerInfo[playerid][pService] == 11 && pduty == 0);
im thinking its that>?:X


Re: 3 Errors - iLcke - 18.07.2010

I dont think it would be.


Re: 3 Errors - happyface - 18.07.2010

the first error is on line 14243, it doesn't have the ; its looking for

pawn Код:
new skin = PlayerInfo[playerid][pModel];
the other two i believe you just need to put [playerid] after the pduty's like its defined

pawn Код:
if(PlayerInfo[playerid][pService] == 11 && pduty[playerid] == 1)
pawn Код:
else if(PlayerInfo[playerid][pService] == 11 && pduty[playerid] == 0)



Re: 3 Errors - iLcke - 18.07.2010

ah, thanks.


Re: 3 Errors - iLcke - 18.07.2010

Alright new problem, 1st post edit, sorry for double posting


Re: 3 Errors - [XST]O_x - 18.07.2010

Change:
pawn Код:
pduty[playerid] == 0;
To:
pawn Код:
pduty[playerid] = 0;
And:
pawn Код:
pduty[playerid] == 1;
To:
pawn Код:
pduty[playerid] = 1;
Don't use double equal sign outside of if/else statements =P