Problem with a CheckPoint - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with a CheckPoint (
/showthread.php?tid=659687)
Problem with a CheckPoint -
Longover - 12.10.2018
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;
}
Re: Problem with a CheckPoint -
KinderClans - 12.10.2018
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.");
}
Re: Problem with a CheckPoint -
TheToretto - 12.10.2018
Hello there, DisablePlayerCheckpoint can't be used for race checkpoints. Use DisablePlayerRaceCheckpoint
Re: Problem with a CheckPoint -
Calisthenics - 13.10.2018
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)
Re: Problem with a CheckPoint -
Dennis12 - 13.10.2018
Код:
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!");
}