Checkpoint help =( - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Checkpoint help =( (
/showthread.php?tid=229851)
Checkpoint help =( -
Randomai - 22.02.2011
Hello.Im making "guns pick-up place" in outside of lspd and im making bank enter too.
when i enter to lspd gun pick-up checkpoint, it will go to that bank.Hard to tell, but here is some codes.
Код:
public OnPlayerSpawn(playerid)
{
SetPlayerCheckpoint(playerid, 2303.2053,-16.0775,26.4844, 2);
SetPlayerCheckpoint(playerid, 1568.5647,-1693.0901,5.8906, 2);
Код:
public OnPlayerEnterCheckpoint(playerid)
{
if(IsPlayerInCheckpoint(playerid))
{
SendClientMessage(playerid, COLOR_GREEN, "||_Last Weapons Of Lost Santos_||");
SendClientMessage(playerid, COLOR_RED, "Choose wisely, or it can cause your death.");
SendClientMessage(playerid, COLOR_WHITE, "Thermal Goggles - Price: $500 - type /thermal");
SendClientMessage(playerid, COLOR_WHITE, "Desert Eagle - Price: $1000 - type /desert");
SendClientMessage(playerid, COLOR_WHITE, "Molotov - Price: $1000 - type /molotov");
SendClientMessage(playerid, COLOR_WHITE, "Mp5 - Price: $1500 - type /mp5");
SendClientMessage(playerid, COLOR_WHITE, "Ak-47 Rifle - Price: $2000 - type /ak");
SendClientMessage(playerid, COLOR_WHITE, "M4 Rifle - Price: $2500 - type /m4");
SendClientMessage(playerid, COLOR_WHITE, "Sniper rifle - Price: $3000 - type /sniper");
SendClientMessage(playerid, COLOR_WHITE, "Combat Shotgun - Price: $4000 - type /shotgun");
SendClientMessage(playerid, COLOR_RED, "[Warning] MAKE YOUR CHOICES FAST, ZOMBIES ARE ON THEIR WAY HERE!");
}
if(IsPlayerInCheckpoint(playerid))
{
SendClientMessage(playerid, COLOR_WHITE, "You entered to bank");
SetPlayerPos(playerid, 2309.7588, -15.3791, 26.7496);
SetPlayerFacingAngle(playerid, 270.7787);
SetCameraBehindPlayer(playerid);
}
}
Re: Checkpoint help =( -
Stigg - 22.02.2011
Use a streamer for your checkpoints and give them an id:
pawn Код:
checky1 = SetPlayerCheckpoint(playerid, 2303.2053,-16.0775,26.4844, 2);
checky2 = SetPlayerCheckpoint(playerid, 1568.5647,-1693.0901,5.8906, 2);
Then under OnPlayerEnterCheckpoint:
pawn Код:
if(checkpointid == checky1)
{
//Do your stuff
if(checkpointid == checky2)
{
//Do your stuff
Try here for a good all round streamer.
https://sampforum.blast.hk/showthread.php?tid=102865
Peace...
Re: Checkpoint help =( -
Randomai - 22.02.2011
it says: error 017: undefined symbol "checkpointid"