CMD:Findcar
#1

Hey Guys, did I do something wrong?

pawn Код:
CMD:findcar(playerid, params[])
{
    new vid;
    if(sscanf(params, "d", vid)) return SCM(playerid, COLOR_LIGHTRED, "USAGE: /findcar [1/2]");
    if(vid == 1)
    {
        if(PlayerInfo[playerid][pPcarkey] == 9999) return SCM(playerid, COLOR_GREY, "You don't have a car");
        new carid = PlayerInfo[playerid][pPcarkey];
        new Float:X, Float:Y, Float:Z;
        new zone[MAX_ZONE_NAME];
        new string[256];
        GetVehicle2DZone(carid, zone, MAX_ZONE_NAME);
        GetVehiclePos(carid, X,Y,Z);
        if(Searching[playerid] == 0)
        {
            Searching[playerid] = 1;
            SetPlayerMapIcon(playerid, 500 + playerid, X,Y,Z, 41, COLOR_YELLOW);
            format(string, sizeof(string),"Your car is at %s, red marker has been set at the map. Type /foundit when you have found it.",zone);
            SCM(playerid, TEAM_GROVE_COLOR, string);
        }
        else
        {
            RemovePlayerMapIcon(playerid, carid+1);
            SetPlayerMapIcon(playerid, 500 + playerid, X,Y,Z, 41, COLOR_YELLOW);
            format(string, sizeof(string),"Your car is at %s, red marker has been set at the map. Type /foundit when you have found it.",zone);
            SCM(playerid, TEAM_GROVE_COLOR, string);
        }
    }
    else if(vid == 2)
    {
        if(PlayerInfo[playerid][pPcarkey2] == 9999) return SCM(playerid, COLOR_GREY, "You don't have a 2nd car");
        new carid = PlayerInfo[playerid][pPcarkey2];
        new Float:X, Float:Y, Float:Z;
        new zone[MAX_ZONE_NAME];
        new string[256];
        GetVehicle2DZone(carid, zone, MAX_ZONE_NAME);
        GetVehiclePos(carid, X,Y,Z);
        if(Searching[playerid] == 0)
        {
            Searching[playerid] = 1;
            SetPlayerMapIcon(playerid, 500 + playerid, X,Y,Z, 41, COLOR_YELLOW);
            format(string, sizeof(string),"Your car is at %s, red marker has been set at the map. Type /foundit when you have found it.",zone);
            SCM(playerid, TEAM_GROVE_COLOR, string);
        }
        else
        {
            RemovePlayerMapIcon(playerid, carid+1);
            SetPlayerMapIcon(playerid, 500 + playerid, X,Y,Z, 41, COLOR_YELLOW);
            format(string, sizeof(string),"Your car is at %s, red marker has been set at the map. Type /foundit when you have found it.",zone);
            SCM(playerid, TEAM_GROVE_COLOR, string);
        }
    }
    else
    {
        SCM(playerid, COLOR_LIGHTRED, "You do not have a car.");
    }
    return 1;
}
The map icons don't show?
Reply


Messages In This Thread
CMD:Findcar - by UnknownGamer - 01.08.2013, 13:11
Re: CMD:Findcar - by conor565 - 01.08.2013, 16:09
Re: CMD:Findcar - by Pk93 - 01.08.2013, 16:49
Re: CMD:Findcar - by conor565 - 02.08.2013, 02:09

Forum Jump:


Users browsing this thread: 1 Guest(s)