DIALOG TRACK
#1

Hello Sir,
Actually i want to make this little findcar script into /trackcar that can popup dialogue, and show car names that owned by player and also show empty slot and that can track car by selecting slot 1 or 2


pawn Код:
if(strcmp(cmd, "/findcar", true) == 0) // By Robin Hellman
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "Using: /findcar [Vehicle 1, 2 or 3]");
                return 1;
            }
            new number = strval(tmp);
            if(number < 1 || number > 3)
                {
                    SendClientMessage(playerid, COLOR_GREY, "   Vehicle 1, 2 or 3.");
                    return 1;
                }
            if(number == 1)
            {
                if(PlayerInfo[playerid][pPcarkey] == 9999)
                {
                    SendClientMessage(playerid, COLOR_GREY, "Do not have a car in the first slot!");
                    return 1;
                }
                new carid = PlayerInfo[playerid][pPcarkey];
                new Float:X, Float:Y, Float:Z;
                new zone[MAX_ZONE_NAME];
                GetVehicle2DZone(carid, zone, MAX_ZONE_NAME);
                GetVehiclePos(carid, X,Y,Z);
                if(Searching[playerid] == 0)
                {
                    Searching[playerid] = 1;
                    SetPlayerCheckpoint(playerid, X,Y,Z, 5.0);
                    format(string, sizeof(string),"Your car is marked on the map (red marker), are located in the zone %s!",zone);
                    SendClientMessage(playerid, COLOR_GREY, string);
                }
                else
                {
                    SetPlayerCheckpoint(playerid, X,Y,Z, 5.0);
                    format(string, sizeof(string),"Your car is marked on the map (red marker), are located in the zone %s!",zone);
                    SendClientMessage(playerid, COLOR_GREY, string);
                }
            }
            else if(number == 2)
            {
                if(PlayerInfo[playerid][pPcarkey2] == 9999)
                {
                    SendClientMessage(playerid, COLOR_GREY, "Do not have a car in the first slot!");
                    return 1;
                }
                new carid = PlayerInfo[playerid][pPcarkey2];
                new Float:X, Float:Y, Float:Z;
                new zone[MAX_ZONE_NAME];
                GetVehicle2DZone(carid, zone, MAX_ZONE_NAME);
                GetVehiclePos(carid, X,Y,Z);
                if(Searching[playerid] == 0)
                {
                    Searching[playerid] = 1;
                    SetPlayerCheckpoint(playerid, X,Y,Z, 5.0);
                    format(string, sizeof(string),"Your car is marked on the map (red marker), are located in the zone %s!",zone);
                    SendClientMessage(playerid, COLOR_GREY, string);
                }
                else
                {
                    SetPlayerCheckpoint(playerid, X,Y,Z, 5.0);
                    format(string, sizeof(string),"Your car is marked on the map (red marker), are located in the zone %s!",zone);
                    SendClientMessage(playerid, COLOR_GREY, string);
                }
            }
            else if(number == 3)
            {
                if(PlayerInfo[playerid][pPcarkey3] == 9999)
                {
                    SendClientMessage(playerid, COLOR_GREY, "Do not have a car in the first slot!");
                    return 1;
                }
                new carid = PlayerInfo[playerid][pPcarkey3];
                new Float:X, Float:Y, Float:Z;
                new zone[MAX_ZONE_NAME];
                GetVehicle2DZone(carid, zone, MAX_ZONE_NAME);
                GetVehiclePos(carid, X,Y,Z);
                if(Searching[playerid] == 0)
                {
                    Searching[playerid] = 1;
                    SetPlayerCheckpoint(playerid, X,Y,Z, 5.0);
                    format(string, sizeof(string),"Your car is marked on the map (red marker), are located in the zone %s!",zone);
                    SendClientMessage(playerid, COLOR_GREY, string);
                }
                else
                {
                    SetPlayerCheckpoint(playerid, X,Y,Z, 5.0);
                    format(string, sizeof(string),"Your car is marked on the map (red marker), are located in the zone %s!",zone);
                    SendClientMessage(playerid, COLOR_GREY, string);
                }
            }
        }
        return 1;
    }

    if(strcmp(cmd, "/foundit", true) == 0) // By CuervO_NegrO
    {
        if(IsPlayerConnected(playerid))
        {
            if(Searching[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "You are not searching your car");
                return 1;
            }
            DisablePlayerCheckpoint(playerid);
            Searching[playerid] = 0;
            SendClientMessage(playerid, COLOR_GREY, "* Marker Removed. Type /findcar(2) to create a marker on the car if you loose it again.");
        }
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)