Whats wrong with this?
#4

Quote:
Originally Posted by Alex_Obando
Посмотреть сообщение
This does not support on Sscanf.

Try using strmp.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/surrender", cmdtext, true, 10) == 0)
    {
        if(PlayerInfo[playerid][pTeam] ==0)
    {
        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
        PlayerInfo[playerid][pSurrender] = 1;
    }
    else (PlayerInfo[playerid][pSurrender] ==1)
    }
        ClearAnimations(playerid);
        PlayerInfo[playerid][pSurrender] = 0;
    }
    return 1;
}
    return 0;
}
Why would i use strcmp?

Strcmp= Slow

Yes, OnPlayerCommandText is removed. I changed it so the code looks like this.


pawn Код:
CMD:surrender(playerid,params[])
{
    if(PlayerInfo[playerid][pSurrender] ==0)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
        {
            ApplyAnimation(playerid,"ROB_BANK","SHP_HandsUp_Scr",4.1,1,1,1,1,1,1);
            TogglePlayerControllable(playerid,0);
            PlayerInfo[playerid][pSurrender] = 1;
        }
    }
    else if(PlayerInfo[playerid][pSurrender] ==1)
    {
        ClearAnimations(playerid);
        PlayerInfo[playerid][pSurrender] = 0;
        TogglePlayerControllable(playerid,1);
    }
    return 1;
}

But it still dosnt work
Reply


Messages In This Thread
Whats wrong with this? - by Shockey HD - 16.08.2011, 04:12
Respuesta: Whats wrong with this? - by Alex_Obando - 16.08.2011, 04:27
Re: Whats wrong with this? - by Scenario - 16.08.2011, 04:40
Re: Respuesta: Whats wrong with this? - by Shockey HD - 16.08.2011, 04:53
Re: Respuesta: Whats wrong with this? - by Scenario - 16.08.2011, 04:57
Re: Whats wrong with this? - by Mark1984 - 16.08.2011, 05:16

Forum Jump:


Users browsing this thread: 1 Guest(s)