Problem with a CheckPoint
#1

Problem: When a player enter in checkpoint,the checkpoint is not disabling and i give the mesage: "Trebuie sa ai o masina de tuns iarba.",but i have the correct vehicle.
Trebuie sa ai o masina de tuns iarba. = You must to have a lawn mower.(a car,id 572)

Code:
Код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
	new ccar = IsPlayerInAnyVehicle(playerid);
	new tmpcar = GetPlayerVehicleID(playerid);
	if(TaietorJob[playerid] == 1)
    {
        if(GetPlayerVehicleID(playerid) == 572)
        {
                DisablePlayerCheckpoint(playerid);
                TaietorJob[playerid] = 2;
                SetPlayerCheckpoint(playerid, 773.2032,-1242.4979,13.1317, 5.0);
                GivePlayerCash(playerid, 7);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai primit 7 lei pentru munca prestata!");
		}
		else return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa ai o masina de tuns iarba.");
		return 1;
    }
Reply
#2

pawn Код:
if(GetPlayerVehicleID(playerid) == 572)
        {
                DisablePlayerRaceCheckpoint(playerid);
                TaietorJob[playerid] = 2;
                SetPlayerCheckpoint(playerid, 773.2032,-1242.4979,13.1317, 5.0);
                GivePlayerCash(playerid, 7);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai primit 7 lei pentru munca prestata!");
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa ai o masina de tuns iarba.");
    }
Reply
#3

Hello there, DisablePlayerCheckpoint can't be used for race checkpoints. Use DisablePlayerRaceCheckpoint
Reply
#4

You need to check the vehicle model.
pawn Код:
if (GetVehicleModel(tmpcar) == 572)
or if you remove `ccar` and `tmpcar` as they are unnecessary (not used at all/more than once)
pawn Код:
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 572)
Reply
#5

Код:
if(TaietorJob[playerid] == 1)
{
if(GetPlayerVehicleID(playerid) != 572) return SendClientMessage(playerid, -1, "Your message"); 
DisablePlayerRaceCheckpoint(playerid); // You have a RACE CHECKPOINT, NOT A NORMAL CHECKPOINT
TaietorJob[playerid] = 2; 
SetPlayerRaceCheckpoint(...); // SetPlayerRaceCheckpoint(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size)
GivePlayerCash(playerid, 7);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai primit 7 lei pentru munca prestata!"); 
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)