01.08.2013, 13:11
Hey Guys, did I do something wrong?
The map icons don't show?
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;
}