dcmd not work
#1

I'm making spec command but i don't debug the code....
Debug 1 shows what i enter but
Spec[playerid] shows me chars...
code for help..

pawn Код:
new Spec[MAX_PLAYERS];
new specs[MAX_PLAYERS];
dcmd_spec(playerid,params[])
{
    new t;
    if(PI[playerid][Admin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not Admin:)!");
    if(sscanf(params, "s",t)) return SendClientMessage(playerid, COLOR_GREY, "/spec [id]");
    else
    {
        new t2[128];
        format(t2,sizeof(t2),"%s",t);
        if(strlen(t2)> 0)
        {
            if(strcmp("off", t2, true))
            {
                Spec[playerid] = (-1);
            }
            else
            {
                Spec[playerid] = t;
            }
        }
        print(t2); // for debug
        print(Spec[playerid]); // for debug
        if(Spec[playerid] != (-1))
        {
            new vehicle2;
            vehicle2 = GetPlayerVehicleID(t);
            if(vehicle2 == 0)
            {
                TogglePlayerSpectating(playerid, 1);
                PlayerSpectatePlayer(playerid, t);
                specs[playerid] = 1;
            }
            else
            {
                TogglePlayerSpectating(playerid, 1);
                PlayerSpectateVehicle(playerid, vehicle2);
                specs[playerid] = 1;
            }
        }
        else
        {
            TogglePlayerSpectating(playerid, 0);
            PlayerSpectatePlayer(playerid, playerid);
            specs[playerid] = 0;
        }
    }
    return 1;
}
Reply


Messages In This Thread
dcmd not work - by whitedragon - 03.12.2010, 15:46
Re: dcmd not work - by whitedragon - 03.12.2010, 17:00
Re: dcmd not work - by Ash. - 03.12.2010, 17:01
Re: dcmd not work - by whitedragon - 03.12.2010, 18:30
Re: dcmd not work - by whitedragon - 03.12.2010, 19:22
Re: dcmd not work - by dice7 - 03.12.2010, 19:26

Forum Jump:


Users browsing this thread: 1 Guest(s)