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



Unknown Command - NealPeteros - 11.11.2016

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?


Re: Unknown Command - JimmyCh - 11.11.2016

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


Re: Unknown Command - NealPeteros - 11.11.2016

Nothing. Compiles fine. No errors.


Re: Unknown Command - Banditul18 - 11.11.2016

Код:
            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?


Re: Unknown Command - NealPeteros - 11.11.2016

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


Re: Unknown Command - NealPeteros - 11.11.2016

Still need help


Re: Unknown Command - Dayrion - 11.11.2016

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


Re: Unknown Command - NealPeteros - 11.11.2016

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?


Re: Unknown Command - Stinged - 11.11.2016

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


Re: Unknown Command - SyS - 11.11.2016

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.