23.07.2011, 17:55
Sir can you fix this code in this
pawn Код:
if(strcmp(cmd, "/findcar", true) == 0) // By DraGoN
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Example: /findcar [Card slot id 1 or 2]");
return 1;
}
new number = strval(tmp);
if(number < 1 || number > 3)
{
SendClientMessage(playerid, COLOR_GREY, "Vehicle id 1 or 2.");
return 1;
}
if(number == 1)
{
if(PlayerInfo[playerid][pPcarkey] == 9999)
{
SendClientMessage(playerid, COLOR_GREY, "No Vehicle in this car!");
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 cars are marked on the map (red marker), located in the zone %s!",zone);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
else
{
SetPlayerCheckpoint(playerid, X,Y,Z, 5.0);
format(string, sizeof(string),"Your cars are marked on the map (red marker), located in the zone %s!",zone);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
}
else if(number == 2)
{
if(PlayerInfo[playerid][pPcarkey3] == 9999)
{
SendClientMessage(playerid, COLOR_GREY, "No Vehicle in this car");
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 cars are marked on the map (red marker), located in the zone %s!",zone);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
else
{
SetPlayerCheckpoint(playerid, X,Y,Z, 5.0);
format(string, sizeof(string),"Your cars are marked on the map (red marker), located in the zone %s!",zone);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
}
}
return 1;
}

