On Player Text Help
#1

PHP код:
if(Masked[playerid] == 1)
    {
        
format(stringsizeof(string), "Stranger says, \"%s\""text);
        else 
format(stringsizeof(string), "Stranger says: [%s Accent] %s"PlayerInfo[playerid][pAccent], text);
    } 
When I try and compile after adding this code I get 26 errors saying undefined symbol.

This may be causing errors from the brackets:
PHP код:
CMD:mask(playeridparams[])
{
    new 
randomID random(200);
    new 
string[35];
    if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(
PlayerInfo[playerid][pMasked] == 0;)
    {
        
PlayerInfo[playerid][pMasked] = 1;
        
SetPlayerAttachedObject(playerid9190372104.70.090900);//You can change this however you want, use sa-mp wiki for more info, right now is HockeyMask2
        
SendClientMessage(playeridCOLOR_WHITE"You have put on a mask! (/mask to romove it)");
        for(new 
0MAX_PLAYERSi++)
        {
            
ShowPlayerNameTagForPlayer(iplayerid0); // ShowPlayerNameTagForPlayer(i, playerid, 0) hide name for all players
        
}
    }
    else
    {
        
PlayerInfo[playerid][pMasked] = 0;
        
SendClientMessage(playeridCOLOR_WHITE"You have removed your mask!"); // This is message what was send when you remove your mask
        
if(IsPlayerAttachedObjectSlotUsed(playerid9))
        {
            
RemovePlayerAttachedObject(playerid9);
            {
                for(new 
0MAX_PLAYERSi++)
                {
                    
ShowPlayerNameTagForPlayer(iplayerid1); // ShowPlayerNameTagForPlayer(i, playerid, 1) show name back.
                
}
            }
            return 
1;
        }
    } 
Код:
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(696) : error 017: undefined symbol "RPN"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(697) : error 017: undefined symbol "SendRobberyMessage"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(698) : error 017: undefined symbol "SendCopMessage"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(716) : error 017: undefined symbol "IsACop"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(720) : error 017: undefined symbol "IsACop"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(723) : error 017: undefined symbol "GiveZaiatMoney"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(861) : error 017: undefined symbol "IsPlayerLoggedIn"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(906) : error 017: undefined symbol "cmd_hangup"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(909) : error 017: undefined symbol "ResetZaiatWeapons"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(1391) : error 017: undefined symbol "split"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(1483) : error 017: undefined symbol "IsPlayerLoggedIn"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(1488) : error 017: undefined symbol "RPNU"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(1510) : error 017: undefined symbol "SaveZaiatAmmo"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(1707) : error 017: undefined symbol "SaveToys"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(1724) : error 017: undefined symbol "RPNU"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(1952) : error 017: undefined symbol "LoadToys"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(1960) : error 017: undefined symbol "RPN"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(1975) : error 017: undefined symbol "RPN"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(1976) : error 017: undefined symbol "SendAdminMessage"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(1979) : error 017: undefined symbol "RPN"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(1980) : error 017: undefined symbol "SendAdminMessage"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(1984) : error 017: undefined symbol "RPN"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(1985) : error 017: undefined symbol "SendAdminMessage"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(2045) : error 017: undefined symbol "split"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(2071) : error 017: undefined symbol "RHS"
C:\Users\Aaron\Desktop\PDRPSERVER\gamemodes\PDRP.pwn(2148) : error 017: undefined symbol "fcreate"
Reply
#2

You forgot the last bracket! You open 7 and close just 6.

Here you are.

pawn Код:
CMD:mask(playerid, params[])
{
    new randomID = random(200);
    new string[35];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pMasked] == 0;)
    {
        PlayerInfo[playerid][pMasked] = 1;
        SetPlayerAttachedObject(playerid, 9, 19037, 2, 10, 4.7, 0.0, 90, 90, 0);//You can change this however you want, use sa-mp wiki for more info, right now is HockeyMask2
        SendClientMessage(playerid, COLOR_WHITE, "You have put on a mask! (/mask to romove it)");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            ShowPlayerNameTagForPlayer(i, playerid, 0); // ShowPlayerNameTagForPlayer(i, playerid, 0) hide name for all players
        }
    }
    else
    {
        PlayerInfo[playerid][pMasked] = 0;
        SendClientMessage(playerid, COLOR_WHITE, "You have removed your mask!"); // This is message what was send when you remove your mask
        if(IsPlayerAttachedObjectSlotUsed(playerid, 9))
        {
            RemovePlayerAttachedObject(playerid, 9);
            {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    ShowPlayerNameTagForPlayer(i, playerid, 1); // ShowPlayerNameTagForPlayer(i, playerid, 1) show name back.
                }
            }
            return 1;
        }
    }
}
Reply
#3

This happens mainly when you don't close your brackets so check for it first when you get like this errors.
Reply
#4

Use Notepad++ to find missing braces more easily. See:

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)