SA-MP Forums Archive
Check points.... - 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: Check points.... (/showthread.php?tid=324803)



Check points.... - viddo - 10.03.2012

How can i make that if a player did something like /mission and he is in a car (Sadler) He gets some check points that he needs to go to and finally he gets 1000 dollars?


Re: Check points.... - Nicholas. - 10.03.2012

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    GivePlayerMoney(playerid, 1000);
    DisablePlayerCheckpoint(playerid);
    return 1;
}
Is this what you mean?


Re: Check points.... - GNGification - 10.03.2012

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mission", cmdtext, true, 10) == 0)
	{
		if(GetPlayerVehicleID == YOUR vehID here!) SetPlayerCheckpoint(playerid, COORDINATES here, 3.0);
		return 1;
	}
	return 0;
}
Код:
public OnPlayerEnterCheckpoint(playerid)
{
	GivePlayerMoney(playerid, 1000);
	DisablePlayerCheckpoint(playerid);
	return 1;
}
Rep would be nice if this did help you =)
tought im on phone so if there is a mistake im sorry

EDIT:
If you need to create more than one checkpoints, you can use this instead:

Код:
public OnPlayerEnterCheckpoint(playerid)
{
	GivePlayerMoney(playerid, 1000);
	DisablePlayerCheckpoint(playerid);
        SetPlayerCheckpoint(playerid, NEW coordinates, 3.0);
	return 1;
}
OR if you're making checkpoints like in a race, you can use SetPlayerRaceCheckpoint
https://sampwiki.blast.hk/wiki/SetPlayerRaceCheckpoint