15.10.2016, 15:57
When I compile it, PAWN Compiler stops. What seems to be the problem?
This is where the timer "WolfShapeshift" is called.
PHP код:
forward WolfShapeshift(playerid);
public WolfShapeshift(playerid);
{
if(isWolf[playerid] == 0)
{
new randomID = random(200);
new string[60];
isWolf[playerid] = true;
GetPlayerName(playerid, string, sizeof(string));
strmid(OldUsername[playerid], string, 0, strlen(string), 64);
OldSkin[playerid] = GetPlayerSkin(playerid);
SetPlayerSkin(playerid, 0);
format(string,sizeof(string), "Werewolf", randomID);
SetPlayerName(playerid, string);
format(string, sizeof(string), "* %s shapeshifts into a werewolf.", OldUsername[playerid]);
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
}
}
return 1;
}
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_YES))
{
if(isWolf[playerid] == 0)
{
new string[100];
format(string, sizeof(string), "* %s growls softly as he begins to shapeshift into a werewolf.", RPName(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SCM(playerid, COLOR_FADE1, "You will now be shapeshifted into a werewolf by 5 seconds.");
SetTimerEx("WolfShapeshift", 5000, false, "i", playerid);
}
else
{
new string[100];
format(string, sizeof(string), "* %s growls softly as he begins to shapeshift back into a human.", RPName(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SCM(playerid, COLOR_FADE1, "You will now be shapeshifted back into a human by 5 seconds.");
SetTimerEx("HumanShapeshift", 5000, false, "i", playerid);
}
}
return 1;
}