SA-MP Forums Archive
/drag cmd script compiling error - 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)
+--- Thread: /drag cmd script compiling error (/showthread.php?tid=462694)



/drag cmd script compiling error - jblac240 - 08.09.2013

I tried to put this filterscript into my NE:RP edit, and I got these errors:
NERP.pwn(73102) : error 029: invalid expression, assumed zero
NERP.pwn(73102 -- 73103) : error 029: invalid expression, assumed zero
NERP.pwn(73103 -- 73104) : error 029: invalid expression, assumed zero
NERP.pwn(73103 -- 73104) : fatal error 107: too many error messages on one line

if(PlayerInfo[playerid][pMember] == 3 is line 73102


This is the code:
Quote:

CMD:drag (playerid, params[])

{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 ||
if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5 ||
if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7 ||
if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9 || PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11 ||
if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13 ||
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, GREY, "CMD:/cuff [playerid]");
if(pCuffed[ID] == 0) return SendClientMessage(playerid, GREY, "This player must first be cuffed");
if(Dragged[ID] == 0 && Dragging[playerid] == 0)
{
Dragged[ID] = 1;
Dragging[playerid] = 1;
format(string, sizeof(string), "You are being dragged by %s.", RemoveUnderScore(playerid));
format(string2, sizeof(string2), " You are dragging %s.", RemoveUnderScore(ID));
SCM(playerid, PURPLE, string2);
SCM(ID, PURPLE, string);
draggedtimer[ID] = SetTimerEx("Draggingt", 1000, 1, "dd", playerid,ID);
}
else
{
Dragged[ID] = 0;
Dragging[playerid] = 0;
SCM(playerid, PURPLE, "You have stopped dragging your target.");
SCM(ID, PURPLE, "You aren't being dragged anymore.");
KillTimer(draggedtimer[ID]);
}
return 1;
}

forward Draggingt(playerid, ID);
public Draggingt(playerid, ID)
{
new Float:dX, Float:dY, Float:dZ;
GetPlayerPos(playerid, dX, dY, dZ);
SetPlayerPos(ID, dX+1, dY, dZ);
}




Re: /drag cmd script compiling error - PrinceKumar - 08.09.2013

pawn Код:
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 );// you forget to close your if condition use this ');' to close it.
if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5 );// here also u forget to close it
if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7);// here also
if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9 || PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11); // here also u forget
if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13); // here also u forget to close it



Re: /drag cmd script compiling error - xganyx - 08.09.2013

Just use

pawn Код:
if(PlayerInfo[playerid][pMember] >= 1 && PlayerInfo[playerid][pLeader] >= 1)