SA-MP Forums Archive
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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: error (/showthread.php?tid=253985)



error - stix - 08.05.2011

pawn Код:
if(strcmp(cmd,"/leaderinfo",true)==0)
    {
    if(PlayerData[playerid][GSLeader] != 1 && PlayerData[playerid][GSco] != 1 && PlayerData[playerid][SBFco] != 1 && PlayerData[playerid][TDFco] != 1 && PlayerData[playerid][IBco] != 1 && PlayerData[playerid][JBco] != 1 && PlayerData[playerid][KTBco] != 1 && PlayerData[playerid][Vco] != 1 && PlayerData[playerid][Variosco] != 1 && PlayerData[playerid][TDBco] != 1 && PlayerData[playerid][SBFLeader] != 1 &&
    PlayerData[playerid][TDFLeader] != 1 && PlayerData[playerid][TDBLeader] != 1 && PlayerData[playerid][IBLeader] != 1 && PlayerData[playerid][JBLeader] != 1 && PlayerData[playerid][KTBLeader] != 1 && PlayerData[playerid][VLeader] != 1 && PlayerData[playerid][VariosLeader] != 1 && PlayerData[playerid][TDBLeader] != 1) return SendClientMessage(playerid,ORANGE,"** You are not a Gang Leader or Co Leader!");
    {
    SendClientMessage(playerid,ORANGE, "** || [LSB] Street Credit - Leader Guide || **");
    SendClientMessage(playerid,ORANGE, "* As a leader you are able to set your member rights , which weapons they are going to use.");
    SendClientMessage(playerid,ORANGE, " A player has a max of 3 weapons to use like UZI, Tec and Shotgun, choose your member weapons wisely.");
    SendClientMessage(playerid,ORANGE, " Remember not to give everyone strong weapons or you will be punished, everyone is able to use melee weapons.");
    SendClientMessage(playerid,ORANGE, " Admins are able to see which players got which rights, so if the leader abuses, he will get caught and justice will be done.");
    SendClientMessage(playerid,ORANGE, " The command to set the gun rights is /setgunrights, with this command you set which weapons a member of your team is able to use.");
    SendClientMessage(playerid,ORANGE, " Follow the rules, use this command wisely and enjoy your stay at the Streetz of Los Santos.");
    SendClientMessage(playerid,ORANGE, " || Weapons List - [ Colt / Shotgun / MP5 / UZI / Tec / Deagle / AK47 / ] ||");
    SendClientMessage(playerid,ORANGE, " || Commands - [ /makeofficial - /removeofficial - /makeog - /removeog - /Makecoleader - /Removecoleader ] ||");
    }
    return 1;
    }
}
can someone tell me whats wrong with this command?

C:\Users\Cristian\Downloads\samp03csvr_win32\gamem odes\lol.pwn(29 : warning 204: symbol is assigned a value that is never used: "string"
C:\Users\Cristian\Downloads\samp03csvr_win32\gamem odes\lol.pwn(298 -- 321) : warning 209: function "OnPlayerCommandText" should return a value
C:\Users\Cristian\Downloads\samp03csvr_win32\gamem odes\lol.pwn(298 -- 324) : error 010: invalid function or declaration
C:\Users\Cristian\Downloads\samp03csvr_win32\gamem odes\lol.pwn(298 -- 326) : error 010: invalid function or declaration
C:\Users\Cristian\Downloads\samp03csvr_win32\gamem odes\lol.pwn(298 -- 329) : error 010: invalid function or declaration
C:\Users\Cristian\Downloads\samp03csvr_win32\gamem odes\lol.pwn(298 -- 329) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.


Re: error - sleepysnowflake - 08.05.2011

This are the lines that shows the errors ?


Re: error - stix - 08.05.2011

298 :
pawn Код:
new string[128];
298-329 :
pawn Код:
new string[128];
    tmp = strtok(cmdtext, idx);
    new tmp2[128];
    tmp2 = strtok(cmdtext, idx);


    if(strcmp(cmd,"/leaderinfo",true)==0)
    {
    if(PlayerData[playerid][GSLeader] != 1 && PlayerData[playerid][GSco] != 1 && PlayerData[playerid][SBFco] != 1 && PlayerData[playerid][TDFco] != 1 && PlayerData[playerid][IBco] != 1 && PlayerData[playerid][JBco] != 1 && PlayerData[playerid][KTBco] != 1 && PlayerData[playerid][Vco] != 1 && PlayerData[playerid][Variosco] != 1 && PlayerData[playerid][TDBco] != 1 && PlayerData[playerid][SBFLeader] != 1 &&
    PlayerData[playerid][TDFLeader] != 1 && PlayerData[playerid][TDBLeader] != 1 && PlayerData[playerid][IBLeader] != 1 && PlayerData[playerid][JBLeader] != 1 && PlayerData[playerid][KTBLeader] != 1 && PlayerData[playerid][VLeader] != 1 && PlayerData[playerid][VariosLeader] != 1 && PlayerData[playerid][TDBLeader] != 1) return SendClientMessage(playerid,ORANGE,"** You are not a Gang Leader or Co Leader!");
    {
    SendClientMessage(playerid,ORANGE, "** || [LSB] Street Credit - Leader Guide || **");
    SendClientMessage(playerid,ORANGE, "* As a leader you are able to set your member rights , which weapons they are going to use.");
    SendClientMessage(playerid,ORANGE, " A player has a max of 3 weapons to use like UZI, Tec and Shotgun, choose your member weapons wisely.");
    SendClientMessage(playerid,ORANGE, " Remember not to give everyone strong weapons or you will be punished, everyone is able to use melee weapons.");
    SendClientMessage(playerid,ORANGE, " Admins are able to see which players got which rights, so if the leader abuses, he will get caught and justice will be done.");
    SendClientMessage(playerid,ORANGE, " The command to set the gun rights is /setgunrights, with this command you set which weapons a member of your team is able to use.");
    SendClientMessage(playerid,ORANGE, " Follow the rules, use this command wisely and enjoy your stay at the Streetz of Los Santos.");
    SendClientMessage(playerid,ORANGE, " || Weapons List - [ Colt / Shotgun / MP5 / UZI / Tec / Deagle / AK47 / ] ||");
    SendClientMessage(playerid,ORANGE, " || Commands - [ /makeofficial - /removeofficial - /makeog - /removeog - /Makecoleader - /Removecoleader ] ||");
    }
    return 1;
    }
}

   
    if(strcmp(cmd,"/makecoleader",true)==0)
    {
    if(PlayerData[playerid][GSLeader] != 1 && PlayerData[playerid][SBFLeader] != 1 && PlayerData[playerid][TDFLeader] != 1 && PlayerData[playerid][IBLeader] != 1 && PlayerData[playerid][JBLeader] != 1 && PlayerData[playerid][KTBLeader] != 1 && PlayerData[playerid][VLeader] != 1 && PlayerData[playerid][VariosLeader] != 1 && PlayerData[playerid][TDBLeader] != 1) return SendClientMessage(playerid,ORANGE,"** You are not a Gang Leader!");
    {
    }
    if(strlen(tmp) == 0) return SendClientMessage(playerid, ORANGE, "** Correct Usage - /Makecoleader [ playerid ]");



Re: error - sleepysnowflake - 08.05.2011

1st : Why did you put that new string[128]; when you DO NOT use it in that function you made.
2nd : Do you have that return at the end on OnPlayercommandText ?