Check point not showing correct location
#1

Check point not showing correct location Please fix this code
pawn Код:
if(strcmp(cmd, "/findcar", true) == 0) // By CuervO_NegrO
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pPcarkey] == 9999)
            {
                SendClientMessage(playerid, COLOR_GREY, "You don't have a 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;
                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);
                SendClientMessage(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);
                SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
            }
        }
        return 1;
    }
   
    if(strcmp(cmd, "/findcar2", true) == 0) // By CuervO_NegrO
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pPcarkey2] == 9999)
            {
                SendClientMessage(playerid, COLOR_GREY, "You don't have a 2nd 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;
                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);
                SendClientMessage(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);
                SendClientMessage(playerid, TEAM_GROVE_COLOR, 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;
            }
            RemovePlayerMapIcon(playerid, 500 + playerid);
            Searching[playerid] = 0;
            SendClientMessage(playerid, TEAM_GROVE_COLOR, "* Marker Removed. Type /findcar(2) to create a marker on the car if you loose it again.");
        }
        return 1;
    }
Reply
#2

There's not even a SetPlayerCheckpoint statement in that code, so what do you want us to do about it?
And if you want to use the mapicons for it, you'll have to add MAPICON_GLOBAL_CHECKPOINT as an extra parameter.
Reply
#3

Sir can you fix whole code as using MAPICON_GLOBAL_CHECKPOINT as an extra parameter. ?
Reply
#4

PHP код:
    if(strcmp(cmd"/findcar"true) == 0// By CuervO_NegrO
    
{
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pPcarkey] == 9999)
            {
                
SendClientMessage(playeridCOLOR_GREY"You don't have a car");
                return 
1;
            }
            new 
carid PlayerInfo[playerid][pPcarkey];
            new 
Float:XFloat:YFloat:Z;
            new 
zone[MAX_ZONE_NAME];
            
GetVehicle2DZone(caridzoneMAX_ZONE_NAME);
            
GetVehiclePos(caridX,Y,Z);
            if(
Searching[playerid] == 0)
            {
                
Searching[playerid] = 1;
                
SetPlayerMapIcon(playerid500 playeridX,Y,Z41COLOR_YELLOWMAPICON_GLOBAL);
                
format(stringsizeof(string),"Your car is at %s, red marker has been set at the map. Type /foundit when you have found it.",zone);
                
SendClientMessage(playeridTEAM_GROVE_COLORstring);
            }
            else
            {
                
RemovePlayerMapIcon(playeridcarid+1);
                
SetPlayerMapIcon(playerid500 playeridX,Y,Z41COLOR_YELLOWMAPICON_GLOBAL);
                
format(stringsizeof(string),"Your car is at %s, red marker has been set at the map. Type /foundit when you have found it.",zone);
                
SendClientMessage(playeridTEAM_GROVE_COLORstring);
            }
        }
        return 
1;
    }
    
    if(
strcmp(cmd"/findcar2"true) == 0// By CuervO_NegrO
    
{
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pPcarkey2] == 9999)
            {
                
SendClientMessage(playeridCOLOR_GREY"You don't have a 2nd car");
                return 
1;
            }
            new 
carid PlayerInfo[playerid][pPcarkey2];
            new 
Float:XFloat:YFloat:Z;
            new 
zone[MAX_ZONE_NAME];
            
GetVehicle2DZone(caridzoneMAX_ZONE_NAME);
            
GetVehiclePos(caridX,Y,Z);
            if(
Searching[playerid] == 0)
            {
                
Searching[playerid] = 1;
                
SetPlayerMapIcon(playerid500 playeridX,Y,Z41COLOR_YELLOWMAPICON_GLOBAL);
                
format(stringsizeof(string),"Your car is at %s, red marker has been set at the map. Type /foundit when you have found it.",zone);
                
SendClientMessage(playeridTEAM_GROVE_COLORstring);
            }
            else
            {
                
RemovePlayerMapIcon(playeridcarid+1);
                
SetPlayerMapIcon(playerid500 playeridX,Y,Z41COLOR_YELLOWMAPICON_GLOBAL);
                
format(stringsizeof(string),"Your car is at %s, red marker has been set at the map. Type /foundit when you have found it.",zone);
                
SendClientMessage(playeridTEAM_GROVE_COLORstring);
            }
        }
        return 
1;
    }
    
    if(
strcmp(cmd"/foundit"true) == 0// By CuervO_NegrO
    
{
        if(
IsPlayerConnected(playerid))
        {
            if(
Searching[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"You are not searching your car");
                return 
1;
            }
            
RemovePlayerMapIcon(playerid500 playerid);
            
Searching[playerid] = 0;
            
SendClientMessage(playeridTEAM_GROVE_COLOR"* Marker Removed. Type /findcar(2) to create a marker on the car if you loose it again.");
        }
        return 
1;
    } 
Reply
#5

sir still no checkpoints there
Reply
#6

Use SetPlayerCheckpoint to show a checkpoint else you won't be able to see any checkpoints.
Reply
#7

Sir can kindly put whole code by seting SetPlayerCheckpoint im new and learning it cant do these thing now. thanks
Reply
#8

https://sampwiki.blast.hk/wiki/Function:SetPlayerCheckpoint
If you need a tutorial about checkpoints, check my sig
Reply
#9

thanks it fixed im done
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)