annoying warning - 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: annoying warning (
/showthread.php?tid=389362)
annoying warning -
stix - 01.11.2012
pawn Код:
if (strcmp("/setofficer", cmdtext, true, 10) == 0)
{
new name[MAX_PLAYER_NAME+1], string[128+MAX_PLAYER_NAME+1], string2[128], name2[MAX_PLAYER_NAME+1];
new tmp[128]; tmp = strtok(cmdtext,idx);
new tmp2[128]; tmp2 = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, GRAY, " /setrank [ playerid ] [ rank ]");
return 1;
}
if(!strlen(tmp2))
{
SendClientMessage(playerid, GRAY, "/setrank [ playerid ] [ rank ]");
return 1;
}
new otherid = strval(tmp);
new rank = strval(tmp2);
if(PlayerData[i][LSPDRank] == 11 && PlayerData[otherid][rank] == 11)
{
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(otherid, name2, sizeof(name2));
format(string, sizeof(string), "[LSPD] Co-Chief %s has set your police rank to Police Chief.", name);
format(string2, sizeof(string2), "[LSPD] You have set [ %s ] police rank to Police Chief. ", name2);
SendClientMessage(otherid,GRAY,string);
SendClientMessage(i,GRAY,string2);
PlayerData[otherid][LSPDRank] = 11;
return 1;
}
else{
SendClientMessage(i, GRAY, "You must be a LSPD Chief / Co-Chief to use this command !");
}
return 1;
}
Can someone tell me what's wrong with this ?
if(PlayerData[i][LSPDRank] == 11 && PlayerData[otherid][rank] == 11)
tag mismatch warning
Re: annoying warning -
iJumbo - 01.11.2012
maybe a better tab can solve this? or my eyes are bilnd and i cant see the problem
Re: annoying warning -
sampreader - 01.11.2012
what is "i", it is not defined in that code
Respuesta: annoying warning -
stix - 01.11.2012
for(new i = 0; i < MAX_PLAYERS; i++)
Re: annoying warning -
iJumbo - 01.11.2012
ok but i can't see in the code that loop
change [i] to [playerid]
Respuesta: annoying warning -
stix - 01.11.2012
C:\Users\Cristian\Downloads\samp03e_svr_R2_win32\p awno\swag.pwn(251) : warning 213: tag mismatch
C:\Users\Cristian\Downloads\samp03e_svr_R2_win32\p awno\swag.pwn(262) : warning 213: tag mismatch
pawn Код:
if(PlayerData[playerid][LSPDRank] >= 11 && PlayerData[otherid][Police] >= 11)
pawn Код:
else if(PlayerData[playerid][LSPDRank] >= 10 && PlayerData[otherid][Police] >= 11)
Re: annoying warning -
FUNExtreme - 01.11.2012
Are both "LSPDRank" and "Police" integers?
Respuesta: annoying warning -
stix - 01.11.2012
LSPDRank is a enum Info.
pawn Код:
new Police = strval(tmp2);
new tmp2[128]; tmp2 = strtok(cmdtext,idx);
The problem is with Police, if i set any other rank it will compile correctly.
Respuesta: annoying warning -
stix - 02.11.2012
So ?
Re: annoying warning -
Private200 - 02.11.2012
i think you should make it
pawn Код:
if(PlayerData[playerid][LSPDRank] >= 11 return PlayerData[otherid][Police] >= 11)