Is there something wrong in this code?
#1

When I compile it, PAWN Compiler stops. What seems to be the problem?
PHP код:
forward WolfShapeshift(playerid);
public 
WolfShapeshift(playerid);
{
    if(
isWolf[playerid] == 0)
       {
           new 
randomID random(200);
           new 
string[60];
           
isWolf[playerid] = true;
           
GetPlayerName(playeridstringsizeof(string));
           
strmid(OldUsername[playerid], string0strlen(string), 64);
        
OldSkin[playerid] = GetPlayerSkin(playerid);
        
SetPlayerSkin(playerid0);
           
format(string,sizeof(string), "Werewolf"randomID);
           
SetPlayerName(playeridstring);
           
format(stringsizeof(string), "* %s shapeshifts into a werewolf."OldUsername[playerid]);
        
ProxDetector(20.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
           for(new 
0MAX_PLAYERSi++)
           {
               
ShowPlayerNameTagForPlayer(iplayerid0);
           }
    }
    return 
1;

This is where the timer "WolfShapeshift" is called.
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if (
PRESSED(KEY_YES))
    {
        if(
isWolf[playerid] == 0)
        {
            new 
string[100];
            
format(stringsizeof(string), "* %s growls softly as he begins to shapeshift into a werewolf."RPName(playerid));
            
ProxDetector(20.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
SCM(playeridCOLOR_FADE1"You will now be shapeshifted into a werewolf by 5 seconds.");
            
SetTimerEx("WolfShapeshift"5000false"i"playerid);
        }
        else
        {
            new 
string[100];
              
format(stringsizeof(string), "* %s growls softly as he begins to shapeshift back into a human."RPName(playerid));
            
ProxDetector(20.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
SCM(playeridCOLOR_FADE1"You will now be shapeshifted back into a human by 5 seconds.");
            
SetTimerEx("HumanShapeshift"5000false"i"playerid);
        }
    }
    return 
1;

Reply
#2

Код:
public WolfShapeshift(playerid);
Remove semicolon from there.
Reply
#3

Oops didn't see that
Reply
#4

-Fixed-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)