Annoying sscanf id 0 debug
#3

Here is, an example command:

pawn Код:
CMD:spawn(playerid, params[])
{
    if (Player[playerid][AccountLevel] < 1) return 0;

    new targetid;
    if (sscanf(params, "u", targetid)) return SCM(playerid, COLOR_RED, "* [USAGE]: /spawn [playerid/name]");

    if (! IsPlayerConnected(targetid)) return SCM(playerid, COLOR_RED, "* The specified player is not connected.");
    if (Player[playerid][AccountLevel] < Player[targetid][AccountLevel]) return SCM(playerid, COLOR_RED, "* You cannot use this command on higher level admin.");
    if (GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)  TogglePlayerSpectating(targetid, false);

    SpawnPlayer(targetid);
    PlayerPlaySound(targetid, 1057, 0.0, 0.0, 0.0);
    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);

    new buf[128];
    format(buf, sizeof(buf), "* %s %s has respawned you.", AdminLevelName(playerid),ReturnName(playerid, 0));
    SCM(targetid, COLOR_RED, buf);
    format(buf, sizeof(buf), "* You have respawned %s.", ReturnName(targetid, 0));
    SCM(playerid, COLOR_RED, buf);
    return 1;
}
Reply


Messages In This Thread
Annoying sscanf id 0 debug - by KinderClans - 10.09.2018, 12:31
Re: Annoying sscanf id 0 debug - by KinderClans - 10.09.2018, 12:35
Re: Annoying sscanf id 0 debug - by KinderClans - 10.09.2018, 12:52
Re: Annoying sscanf id 0 debug - by NeXTGoD - 10.09.2018, 15:39
Re: Annoying sscanf id 0 debug - by GameOvr - 10.09.2018, 15:41
Re: Annoying sscanf id 0 debug - by iLearner - 10.09.2018, 15:44
Re: Annoying sscanf id 0 debug - by m4karow - 10.09.2018, 16:19
Re: Annoying sscanf id 0 debug - by KinderClans - 10.09.2018, 17:50
Re: Annoying sscanf id 0 debug - by Grim_ - 11.09.2018, 06:30
Re: Annoying sscanf id 0 debug - by GameOvr - 11.09.2018, 14:59

Forum Jump:


Users browsing this thread: 1 Guest(s)