Unknown Command
#1

PHP код:
CMD:mask(playeridparams[])
{
    if(
pInfo[playerid][pMask] == 1)
    {
        if(
pInfo[playerid][pMaskOn] == 0)
        {
            new 
randomID random(200);
            new 
string[35];
            
pInfo[playerid][pMaskOn] = 1;
            
GetPlayerName(playeridstringsizeof(string));
            
strmid(OldUsername[playerid], string0strlen(string), 64);
            
format(string,sizeof(string), "Stranger"randomID);
            
SetPlayerName(playeridstring);
            
SetPlayerAttachedObject(playerid1190372104.70.090900);
            
SendClientMessage(playerid, -1"You have put on a mask! (/mask to remove it)");
            for(new 
0MAX_PLAYERSi++)
            {
                
ShowPlayerNameTagForPlayer(iplayerid0);
            }
        }
        else if(
pInfo[playerid][pMaskOn] == 1)
        {
             
SetPlayerName(playeridOldUsername[playerid]);
            
pInfo[playerid][pMaskOn] = 0;
            
SendClientMessage(playerid, -1"You have removed your mask!");
            if(
IsPlayerAttachedObjectSlotUsed(playerid1)) RemovePlayerAttachedObject(playerid1);
            for(new 
0MAX_PLAYERSi++)
            {
                
ShowPlayerNameTagForPlayer(iplayerid1);
            }
          }
    }
    else if(
pInfo[playerid][pMask] == 0)
    {
            
SendClientMessage(playeridCOLOR_RED"You don't have a mask. Buy one in the shop.");
            return 
1;
    }
    return 
1;

I don't think there's something wrong here, is there?
Reply
#2

Doesn't look like it.
What happens when you compile?
Reply
#3

Nothing. Compiles fine. No errors.
Reply
#4

Код:
            for(new i = 0,j=GetPlayerPoolSize(); i <=j; i++) 
            { 
                if(!IsPlayerConnected(i)) continue;
                ShowPlayerNameTagForPlayer(i, playerid, 0); 
            }
You can change this if you want, but why you post if you don't have any erros or problems with it?
Reply
#5

Quote:
Originally Posted by Banditul18
Посмотреть сообщение
You can change this if you want, but why you post if you don't have any erros or problems with it?
Error is the title. :P
Reply
#6

Still need help
Reply
#7

Debug your code to see where is the problem. Debugging might help everytime ;p
Reply
#8

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Debug your code to see where is the problem. Debugging might help everytime ;p
What do you mean? I mean like how to do that?
Reply
#9

Install crashdetect. Once it shows "Unknown command", it'll tell you where the error is.
Make you sure compile with debug info.
Reply
#10

It might be a crash compile your script with -d3 flag and try to scan the run time using crash detect plugin and post what is showing on server log.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)