Help with Code (commands)
#2

try this
pawn Код:
new DetectorTimer[MAX_PLAYERS];
    if (strcmp("/detectoron", cmdtext, true, 10) == 0)
    {
        if(PlayerInfo[playerid][pDetector])
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                if(DetectorTimer[playerid] != -1) KillTimer(DetectorTimer[playerid]);//
                DetectorTimer[playerid] = SetTimerEx("RunDetector", 2000, true, "i", playerid);
                SendClientMessage(playerid,-1,"Detector On");
                return 1;
            }
            SendClientMessage(playerid, COLOR_GREY, "** You aren't in a vehicle!");
            return 1;
        }
        SendClientMessage(playerid, COLOR_GREY, "** You don't have a Radar Detector!");
        return 1;
    }
    if (strcmp("/detectoroff", cmdtext, true, 10) == 0)
    {
        if(PlayerInfo[playerid][pDetector])
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                SendClientMessage(playerid,-1,"Detector OFF");
                KillTimer(DetectorTimer[playerid]);
                return 1;
            }
            SendClientMessage(playerid, COLOR_GREY, "** You aren't in a vehicle!");
            return 1;
        }
        SendClientMessage(playerid, COLOR_GREY, "** You don't have a Radar Detector!");
        return 1;
 }
Reply


Messages In This Thread
Help with Code (commands) - by jakejohnsonusa - 24.11.2012, 14:15
Re: Help with Code (commands) - by [HK]Ryder[AN] - 24.11.2012, 14:17
Re: Help with Code (commands) - by Vince - 24.11.2012, 14:18
Re: Help with Code (commands) - by jakejohnsonusa - 24.11.2012, 14:22
Re: Help with Code (commands) - by jakejohnsonusa - 24.11.2012, 14:25

Forum Jump:


Users browsing this thread: 1 Guest(s)