Spec Command
#3

Looks like the second part of the if code is being called. Use this code and tell me if the debug prints this print("spec of"); and print("specing"); and when.
pawn Код:
COMMAND:spec(playerid,params[])
{
    if(PlayerAdmin[playerid] < 1) return SendClientMessage(playerid,COLOR_RED,"You can not use this command!");

    new id;
    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"Usage: /spec <player>");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"Player is not connected!");

    if(GetPVarInt(playerid,"TV") == 0)
    {
        SetPVarInt(playerid,"TV",1);
        TogglePlayerSpectating(playerid,1);
        PlayerSpectatePlayer(playerid,id);
        print("specing...");
    }
    else if(GetPVarInt(playerid,"TV") == 1)
    {
        SetPVarInt(playerid,"TV",0);
        TogglePlayerSpectating(playerid,0);
        print("spec of");
    }
    return 1;
}
Reply


Messages In This Thread
Spec Command - by Blackazur - 05.11.2012, 11:21
AW: Spec Command - by Blackazur - 12.11.2012, 15:20
Re: Spec Command - by Faisal_khan - 12.11.2012, 15:31
AW: Spec Command - by Blackazur - 12.11.2012, 16:31
Re: Spec Command - by Faisal_khan - 13.11.2012, 03:54
AW: Spec Command - by Blackazur - 13.11.2012, 13:06
AW: Spec Command - by Blackazur - 14.11.2012, 14:28

Forum Jump:


Users browsing this thread: 1 Guest(s)