Can anyone see a problem?
#3

Hmm, I don't see a problem but I might be blind. Try this:

pawn Код:
CMD:spec(playerid, params[])
{
    new string[128], tname[MAX_PLAYER_NAME], id;
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1 , "ERROR: You are not an admin!");
    //if (sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /spec [playerid]");

    id = strval(params);

    if(id == playerid)return SendClientMessage(playerid,COLOR_RED,"ERROR: You are not able to spec yourself.");// Just making sure.
    if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid, COLOR_RED, "ERROR: This ID has not been found.");
    TogglePlayerSpectating(playerid, true);
    PlayerSpectatePlayer(playerid, id);
    GetPlayerName(id, tname, sizeof(tname));
    format(string, sizeof(string), "~b~ID: ~w~%d~n~~b~Name: ~w~%s", id, tname);
    GameTextForPlayer(playerid, string, 12000, 4);
    return 1;
}
I commented out sscanf for now and added id = strval(params);

Try it.
Reply


Messages In This Thread
Can anyone see a problem? - by Luis- - 18.08.2011, 17:06
Re: Can anyone see a problem? - by Luis- - 18.08.2011, 17:59
Re: Can anyone see a problem? - by grand.Theft.Otto - 18.08.2011, 18:13
Re: Can anyone see a problem? - by Luis- - 18.08.2011, 18:27
Re: Can anyone see a problem? - by Hiddos - 18.08.2011, 18:37
Re: Can anyone see a problem? - by grand.Theft.Otto - 18.08.2011, 18:39
Re: Can anyone see a problem? - by Luis- - 18.08.2011, 18:41
Re: Can anyone see a problem? - by ElieJabbour - 18.08.2011, 18:50
Re: Can anyone see a problem? - by Luis- - 18.08.2011, 18:51
Re: Can anyone see a problem? - by grand.Theft.Otto - 18.08.2011, 19:09

Forum Jump:


Users browsing this thread: 1 Guest(s)