SA-MP Forums Archive
warnings - 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: warnings (/showthread.php?tid=641174)



warnings - Jaua10 - 12.09.2017

Код HTML:
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1203) : warning 203: symbol is never used: "acceptinvite"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1203) : warning 203: symbol is never used: "fackick"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1203) : warning 203: symbol is never used: "giverank"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1203) : warning 203: symbol is never used: "invite"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1203) : warning 203: symbol is never used: "makeleader"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1203) : warning 203: symbol is never used: "r"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1203) : warning 203: symbol is never used: "radio"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1203) : warning 203: symbol is never used: "uninvite"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Warnings.
how cna i do to remove this warnings?


Re: warnings - Ghazal - 12.09.2017

You have defined new symbols which you haven't used at all, either remove your unused definitions or use
pawn Код:
#pragma unused acceptinvite
and so on.


Re: warnings - Jaua10 - 12.09.2017

doesnt work


Re: warnings - Jaua10 - 12.09.2017

PHP код:
public OnPlayerClickPlayer(playeridclickedplayeridsource)
{
    return 
1;
}
CMD:fackick(playerid,params[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 3)//Replace this with your player variable
    
{
        new 
targetid;//establishes a person on the server to use the command on
        
if(sscanf(params"u"targetid)) return SendClientMessage(playeridCOLOR_RED"/fackick [id]");//tells you how to use the command if you use it incorrectly
        
if(targetid != INVALID_PLAYER_ID)//checks if the id you type in is an id that is not connected to the server
        
{
            
PlayerInfo[targetid][pFaction] = 0//kicks the player from his faction
            
PlayerInfo[targetid][pFacrank] = 0;//sets his rank to 0
            
PlayerInfo[targetid][pFacleader] = 0;// revokes his leadership status
            
SendClientMessage(targetid,COLOR_CYAN,"You have been kicked from your faction by an admin.");//tells them they have been kicked out of their faction by an admin.
        
}
    }
    else
//if they arent an admin then it will send them they message below telling them they may not use the command
    
{
        
SendClientMessage(playeridCOLOR_RED"Only certain levels of Administration have access to this command.");
    }
    return 
1;
}
CMD:makeleader(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 4//Replace this with your player variable
    
{
        new 
targetidfacid;//establishes a player and a faction id, to be typed in
        
if(sscanf(params,"ui",targetidfacid)) return SendClientMessage(playeridCOLOR_RED,"/makeleader [id][Faction id]");//if the command is misused it will tell them the correct way to use it
        
if(targetid != INVALID_PLAYER_ID)//checks if the id you type in is an id that is not connected to the server
        
{
            
PlayerInfo[targetid][pFaction] = facid//sets the players faction to the faction you choose
            
PlayerInfo[targetid][pFacrank] = 10;//sets their rank to the highest rank
            
PlayerInfo[targetid][pFacleader] = facid;//sets their leadership to the id of the faction
            
if(facid == 1)//checks if the factionid typed was 1, and tells them they are the leader of the police below
            
{
                
SendClientMessage(targetid,COLOR_CYAN,"You have been made the leader of the police department");
            }
        }
    }
    else 
//if the player is not an admin it will show the below message telling them they are not an admin.
    
{
        
SendClientMessage(playeridCOLOR_RED"Only certan levels of Administration have access to this command.");
    }
    return 
1;
}
CMD:invite(playeridparams[])
{
    if(
PlayerInfo[playerid][pFacleader] > || PlayerInfo[playerid][pFacrank] >= 8)//checks if the player is the leader of a faction or a high rank in it
    
{
        new 
taridfacid;//establishes a player in the server and a faction id for you to type in
        
if(sscanf(params"u"tarid)) return SendClientMessage(playeridCOLOR_RED"> USAGE: /invite [playerid]");//if the command is not typed correctly, it will show you the correct way to use the command.
        
facid PlayerInfo[playerid][pFaction];//sets the faction the player is being invited to, as the faction the player that is inviting is in.
        
SetPVarInt(tarid"invitefac"facid);//saves the invite, to /accept it
        
SendClientMessage(taridCOLOR_GREEN"You have been invited into a faction, use /acceptinvite to join");//tells you that you have been invited to a faction
    
}
    else 
//if you're not the correct rank it will display the message below stating that the player is not the rank to invite
    
{
        
SendClientMessage(playeridCOLOR_RED"You do not have the rank to invite");
    }
    return 
1;
}
CMD:acceptinvite(playeridparams[])
{
     new 
facidstring[128];//creates a faction id and some text on the players screen
    
facid GetPVarInt(playerid"invitefac");//calls the saved invite from the previous command
    
PlayerInfo[playerid][pFaction] = facid//sets the players faction to that of the person inviting.
    
PlayerInfo[playerid][pFacrank] = 1;//sets the players faction rank to 1
    
format(stringsizeof(string), "> You have accepted the invite to faction %d"facid);//tells the player they have accepted the faction invite
    
SendClientMessage(playeridCOLOR_CYANstring);//shows the above message in the color of CYAN
    
DeletePVar(playerid"invitefac");//deletes the saved invite
    
return 1;
}
CMD:uninvite(playerid,params[])
{
    if(
PlayerInfo[playerid][pFacleader] > || PlayerInfo[playerid][pFacrank] >= 8)//checks if the player is high enough rank to uninvite
    
{
        new 
targetid;//establishes a person to use the command on in the server
        
if(sscanf(params"u"targetid)) return SendClientMessage(playeridCOLOR_RED"/copuninvite [id]");//if the command is not typed correctly it will display how to do it the right way.
        
if(targetid != INVALID_PLAYER_ID)//checks if the id typed is an actual player on the server
        
{
            
PlayerInfo[targetid][pFaction] = 0;//uninvites the player from the faction
            
PlayerInfo[targetid][pFacrank] = 0;//sets the players rank to 0
            
PlayerInfo[targetid][pFacleader] = 0;//revokes leadership status
            
SendClientMessage(targetid,COLOR_CYAN,"You have been kicked from your faction.");//states you've been kicked from the faction to the player the command is used on.
        
}
    }
    else 
//if the player is not the sufficient rank to uninvinte it will state that in the chat
    
{
        
SendClientMessage(playeridCOLOR_RED"You do not have the rank to uninvite");
    }
    return 
1;
}
CMD:giverank(playeridparams[])
{
    if(
PlayerInfo[playerid][pFacleader] > || PlayerInfo[playerid][pFacrank] >= 8)//checks if the player is high enough rank
    
{
        new 
targetidrankstring[128];//establishes a player to use the command on, the rank you want to set, and some words to tell the players the actions used on them.
        
if(sscanf(params"ui"targetidrank)) return SendClientMessage(playeridCOLOR_RED"Usage: /coprank [playerid][rank]");//checks if the command was typed correctly
        
if(!IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_RED"That player is not connected!");//if the player id typed is not connected it will state that to you.
        
if(PlayerInfo[targetid][pFaction] != PlayerInfo[playerid][pFaction]) return SendClientMessage(playeridCOLOR_RED"That player is not in your faction!");//if the player is not in the same faction it will not let him set the rank.
        
if(rank || rank 10) return SendClientMessage(playeridCOLOR_RED,"Rank must be 1-10");//checks if the rank number typed is above or below the correct numbers
        
PlayerInfo[targetid][pFacrank] = rank;//sets the players rank to the rank you choose
        
format(stringsizeof(string), "Your rank has been changed to rank %d!"rank);
        
SendClientMessage(targetidCOLOR_GREENstring);//states that the players rank was changed
    
}
    else 
//if the player is not the correct rank it will display this message below
    
{
        
SendClientMessage(playeridCOLOR_RED"You do not have the rank to set ranks");
    }
    return 
1;
}
CMD:r(playeridparams[]) return cmd_radio(playeridparams);
CMD:radio(playeridparams[])
{
    new 
string[128], text[128], ctext[60], pname[MAX_PLAYER_NAME+1];//establishes a few things needed to tell the players name, rank, and the text he has written.
    
GetPlayerName(playeridpnamesizeof(pname));//gets the name of the player using /radio
    
if(sscanf(params"s[128]"text)) return SendClientMessage(playerid0x46E850FF"SERVER:{FFFFFF} /r(adio) [text]");//if /r is not used correctly it will tell you the correct way to use it
    
if(PlayerInfo[playerid][pFaction] == 1)//checks if the player is in the first faction
    
{
        if(
PlayerInfo[playerid][pFacrank] == 1){ ctext "Cadet"; }//all of these check the players rank and
        
if(PlayerInfo[playerid][pFacrank] == 2){ ctext "Officer"; }// sets each rank to a specific name
        
if(PlayerInfo[playerid][pFacrank] == 3){ ctext "Senior Officer"; }
        if(
PlayerInfo[playerid][pFacrank] == 4){ ctext "Corporal"; }
        if(
PlayerInfo[playerid][pFacrank] == 5){ ctext "Sergeant"; }
        if(
PlayerInfo[playerid][pFacrank] == 6){ ctext "Lieutenant"; }
        if(
PlayerInfo[playerid][pFacrank] == 7){ ctext "Captain"; }
        if(
PlayerInfo[playerid][pFacrank] == 8){ ctext "Commander"; }
        if(
PlayerInfo[playerid][pFacrank] == 9){ ctext "Deputy Chief"; }
        if(
PlayerInfo[playerid][pFacrank] == 10){ ctext "Chief"; }
        
format(stringsizeof(string), "%s %s: %s"ctextpnametext);
        if(
PlayerInfo[playerid][pFaction] > 0)//if the player is not in a faction it will not send him any messages
        
{
            
SendCopMessage(COLOR_PDRADstring);//calls a stock below that checks who the /r should be sent to
        
}
    }
    return 
1;
}
stock SendCopMessage(colstring[])
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
PlayerInfo[i][pFaction] == 1)
            
SendClientMessage(icolstring);         //goes through all the players checking who is and isint in faction 1
    
}
    return 
1;
}
stock IsACopCar(vehicleid)
{
    switch(
GetVehicleModel(vehicleid))
    {
        case 
523,427,528,596,598,597,599,601,497,430: return 1//checks if the vehicle id is a faction restricted vehicle
    
}
    return 
0;

this is my code


Re: warnings - Vince - 12.09.2017

You're not including ZCMD or Pawn.CMD.


Re: warnings - Jaua10 - 12.09.2017

Код HTML:
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1123) : error 029: invalid expression, assumed zero
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1123) : error 029: invalid expression, assumed zero
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1123) : error 017: undefined symbol "FF22"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1123) : fatal error 107: too many error messages on one line

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


4 Errors.
line 1123:

PHP код:
SendClientMessage(taridCOLOR_GREEN"You have been invited into a faction, use /acceptinvite to join");//tells you that you have been invited to a faction 
any help pls


Re: warnings - cuber - 12.09.2017

What's "FF22"?


Re: warnings - Jaua10 - 12.09.2017

PHP код:
#define COL_WHITE "{FFFFFF}"//Color Blanco
#define COL_RED "{F81414}"//Color rojo
#define COL_GREEN "{00FF22}"//Color verde
#define COL_LIGHTBLUE "{00CED1}"//Azul Claro
#define COLOR_GREY 0xC0C0C0FF
#define COLOR_CYAN 0x00FFFFFF
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_RED 0xFF0000FF
#define COLOR_BLUE 0x0000FFFF
#define COLOR_GREEN 00FF22 



Re: warnings - n00blek - 12.09.2017

dont mind those warnings they just tell you that you never used in script. as soon you start using those commands warnings will dissapear


Re: warnings - Jaua10 - 12.09.2017

I FIX ABOUT THE GREEN COLOR, BUT NOW:

Код HTML:
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1333) : warning 217: loose indentation
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1334) : error 017: undefined symbol "i"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1335) : error 017: undefined symbol "i"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1337) : warning 217: loose indentation
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1338) : error 017: undefined symbol "i"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1339) : error 017: undefined symbol "i"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1342) : error 017: undefined symbol "i"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1343) : error 017: undefined symbol "i"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1346) : error 017: undefined symbol "i"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1347) : error 017: undefined symbol "i"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1350) : error 017: undefined symbol "i"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\GTARP.pwn(1351) : error 017: undefined symbol "i"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


10 Errors.
LINE 1326 TO 1354

PHP код:
stock SendfacnameMessage(colstring[])
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
PlayerInfo[i][pFaction] == 2)
            
SendClientMessage(icolstring);         //goes through all the players checking who is and isint in faction 1
    
}
{
        if(
PlayerInfo[i][pFaction] == 3)
            
SendClientMessage(icolstring);         //goes through all the players checking who is and isint in faction 1
    
}
    {
        if(
PlayerInfo[i][pFaction] == 4)
            
SendClientMessage(icolstring);         //goes through all the players checking who is and isint in faction 1
    
}
    {
        if(
PlayerInfo[i][pFaction] == 5)
            
SendClientMessage(icolstring);         //goes through all the players checking who is and isint in faction 1
    
}
    {
        if(
PlayerInfo[i][pFaction] == 6)
            
SendClientMessage(icolstring);         //goes through all the players checking who is and isint in faction 1
    
}
    {
        if(
PlayerInfo[i][pFaction] == 7)
            
SendClientMessage(icolstring);         //goes through all the players checking who is and isint in faction 1
    
}
    return 
1;

WHATS WRONG?