SA-MP Forums Archive
[Tutorial] How to use checkpoints - 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: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] How to use checkpoints (/showthread.php?tid=262374)

Pages: 1 2 3


Re: How to use checkpoints - TheArcher - 20.09.2011

Nice tutorial.


Re: How to use checkpoints - Wesley221 - 20.09.2011

Thanks


Re: How to use checkpoints - vassilis - 29.09.2011

Helpful Tutorial N1 Wesley More Tutorials By you would be useful!!


Re: How to use checkpoints - Wesley221 - 29.09.2011

Quote:
Originally Posted by vassilis
View Post
Helpful Tutorial N1 Wesley More Tutorials By you would be useful!!
Thanks

And what sort of tutorial you would like?


Re: How to use checkpoints - vassilis - 30.09.2011

Emm well i have seen lot tutorials for npcs or textdraws but none was very understandable...well it would be useful to make a simple menu and dialog tutorial for the new scripters.


Re: How to use checkpoints - Wesley221 - 30.09.2011

Quote:
Originally Posted by vassilis
View Post
Emm well i have seen lot tutorials for npcs or textdraws but none was very understandable...well it would be useful to make a simple menu and dialog tutorial for the new scripters.
Im currencly working on a tutorial, when im done with that one imma make one with menus/dialogs


Re: How to use checkpoints - vassilis - 30.09.2011

hmm ok hope it will be a good one like this..!


Re: How to use checkpoints - stamos007 - 10.10.2011

#include a_samp
#define COLOR_YELLOW 0xFFFF00AA
new Ccp[MAX_PLAYERS];

public OnPlayerText(playerid, text[])
{
new textstring[128];
format(textstring, sizeof(textstring), "[%i] %s", playerid, text);
SendPlayerMessageToAll(playerid, textstring);
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mototele", cmdtext, true, 10)==0)
{
SetPlayerPos(playerid,1224.370849,109.414886,21.41 2073);
SetPlayerInterior(playerid,0);
SendClientMessage(playerid, COLOR_YELLOW, "(INFO)Pata /motomission gia na arxiseis tin apostoli sou!");
return 1;
}
if (strcmp("/motomission", cmdtext, true, 10)==0)
{
SetPlayerCheckpoint(playerid,1139.513671,137.11279 2,28.987579,3.0);
Ccp[playerid] = 1;
return 1;
}
return 0;
}

public OnPlayerEnterCheckpoint(playerid)
{
if(Ccp[playerid] == 1)
{
DisablePlayerCheckpoint(playerid);
Ccp[playerid] = 2;
SetPlayerCheckpoint(playerid,1029.829833,152.51452 6,29.566751,3.0);
}
if(Ccp[playerid] == 2)
{
DisablePlayerCheckpoint(playerid);
Ccp[playerid] = 3;
SetPlayerCheckpoint(playerid,946.965515,175.549880 ,31.342302,3.0);
}
if(Ccp[playerid] == 3)
{
DisablePlayerCheckpoint(playerid);
Ccp[playerid] = 4;
SetPlayerCheckpoint(playerid,909.895385,201.056076 ,32.546501,3.0);
}
if(Ccp[playerid] == 4)
{
DisablePlayerCheckpoint(playerid);
Ccp[playerid] = 5;
SetPlayerCheckpoint(playerid,701.218200,219.563552 ,26.110618,3.0);
}
if(Ccp[playerid] == 5)
{
DisablePlayerCheckpoint(playerid);
Ccp[playerid] = 6;
SetPlayerCheckpoint(playerid,518.209228,145.517745 ,23.537740,3.0);
}
if(Ccp[playerid] == 6)
{
DisablePlayerCheckpoint(playerid);
Ccp[playerid] = 7;
SetPlayerCheckpoint(playerid,523.288696,53.878677, 20.279356,3.0);
}
if(Ccp[playerid] == 7)
{
DisablePlayerCheckpoint(playerid);
Ccp[playerid] = 8;
SetPlayerCheckpoint(playerid,579.372436,-47.698345,21.331911,3.0);
}
if(Ccp[playerid] ==
{
DisablePlayerCheckpoint(playerid);
Ccp[playerid] = 9;
SetPlayerCheckpoint(playerid,691.816162,-25.689786,26.147438,3.0);
}
if(Ccp[playerid] == 9)
{
DisablePlayerCheckpoint(playerid);
Ccp[playerid] = 10;
SetPlayerCheckpoint(playerid,903.169677,0.213338,9 0.856170,3.0);
}
if(Ccp[playerid] == 10)
{
DisablePlayerCheckpoint(playerid);
Ccp[playerid] = 11;
SetPlayerCheckpoint(playerid,1064.725952,0.473035, 77.407127,3.0);
}
if(Ccp[playerid] == 11)
{
DisablePlayerCheckpoint(playerid);
Ccp[playerid] = 12;
SetPlayerCheckpoint(playerid,960.284790,-54.722476,77.577148,3.0);
}
if(Ccp[playerid] == 12)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid,COLOR_YELLOW,"Sigxariti ria nikises Vraveio = 3000");
GivePlayerMoney(playerid,3000);
Ccp[playerid] = 0;
DestroyVehicle(playerid);
}
return 1;
}
// When I go to the first checkpoint it gives me the reward... why? Please tell me fast!


Re: How to use checkpoints - wups - 10.10.2011

The setplayermoney part is BAD. + There's no such native function.


Re: How to use checkpoints - Wesley221 - 23.10.2011

A ZCMD command should be outside of any callback.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    return 0;
}  

COMMAND:start(playerid, params[])//LINE 100 HERE
{
    if( IsPlayerInRangeOfPoint( playerid, 7.0, 1017.3148, -929.1449, 420.1316 ) ) // change the '1, 2, 3' to the coords for bigjump 1 (example)
    {
     SetPlayerVirtualWorld(playerid, 1);
     PutPlayerInVehicle(playerid, 411, 0);   // when the player is at bigjump 1, do this
    }
    if( IsPlayerInRangeOfPoint( playerid, 7.0, 1946.0314, -1921.3646, 584.5061 ) ) // change the '4, 5, 6' to the coords for bigjump 2 (example)
    {
        SetPlayerVirtualWorld(playerid, 2);
        PutPlayerInVehicle(playerid, 411, 0);
    }
    if( IsPlayerInRangeOfPoint( playerid, 7.0, 2312.9204, 986.5928, 501.5012 ) ) // change the '7, 8, 9' to the coords for driftplace 137 (example)
    {
        SetPlayerVirtualWorld(playerid, 3);
        PutPlayerInVehicle(playerid, 411, 0);
    }
    return 1;
}



Re: How to use checkpoints - manchestera - 23.10.2011

I think im using the wrong checkpoint as it shows a red blip on the minimap but nothing on the ground im after the small one not the massive on also it ist spawning me into the car.

Код:
public OnFilterScriptInit()
{
	CreateDynamicCP(1017.3148, -929.1449, 420.1316, 3, 0, 0, -1, 100.0);
	CreateDynamicCP(1946.0314, -1921.3646, 584.5061, 3, 0, 0, -1, 100.0);
	CreateDynamicCP(1017.3148, -929.1449, 420.1316, 3, 0, 0, -1, 100.0);
	return 1; 
}

Код:
}
	COMMAND:start(playerid, params[])
{
    if( IsPlayerInRangeOfPoint( playerid, 7.0, 1017.3148, -929.1449, 420.1316 ) ) // change the '1, 2, 3' to the coords for bigjump 1 (example)
    {
     SetPlayerVirtualWorld(playerid, 1);
	 PutPlayerInVehicle(playerid, 411, 0);   // when the player is at bigjump 1, do this
    }
    if( IsPlayerInRangeOfPoint( playerid, 7.0, 1946.0314, -1921.3646, 584.5061 ) ) // change the '4, 5, 6' to the coords for bigjump 2 (example)
    {
        SetPlayerVirtualWorld(playerid, 2);
        PutPlayerInVehicle(playerid, 411, 0);
    }
    if( IsPlayerInRangeOfPoint( playerid, 7.0, 2312.9204, 986.5928, 501.5012 ) ) // change the '7, 8, 9' to the coords for driftplace 137 (example)
    {
        SetPlayerVirtualWorld(playerid, 3);
        PutPlayerInVehicle(playerid, 411, 0);
    }
	return 1;
}



Re: How to use checkpoints - Wesley221 - 23.10.2011

pawn Код:
CreateDynamicCP(1017.3148, -929.1449, 420.1316, CHANGEME, 0, 0, -1, 100.0);
Change the 'CHANGEME' to the size you want. Im not sure, but i think 3.0/2.0 is a little one


Re: How to use checkpoints - manchestera - 23.10.2011

Still can get it to show up am i using the right one for the small red checkpoint on the floor ?


Re: How to use checkpoints - Wesley221 - 24.10.2011

Ooh wait, you want when you do /start, it shows a checkpoint that's in front of you?
pawn Код:
COMMAND:start(playerid, params[])
{
    if( IsPlayerInRangeOfPoint( playerid, 7.0, 1017.3148, -929.1449, 420.1316 ) ) // change the '1, 2, 3' to the coords for bigjump 1 (example)
    {
        SetPlayerVirtualWorld(playerid, 1);
        PutPlayerInVehicle(playerid, 411, 0);   // when the player is at bigjump 1, do this
        CreateDynamicCheckPoint(....);
    }
    if( IsPlayerInRangeOfPoint( playerid, 7.0, 1946.0314, -1921.3646, 584.5061 ) ) // change the '4, 5, 6' to the coords for bigjump 2 (example)
    {
        SetPlayerVirtualWorld(playerid, 2);
        PutPlayerInVehicle(playerid, 411, 0);
        CreateDynamicCheckPoint(....);
    }
    if( IsPlayerInRangeOfPoint( playerid, 7.0, 2312.9204, 986.5928, 501.5012 ) ) // change the '7, 8, 9' to the coords for driftplace 137 (example)
    {
        SetPlayerVirtualWorld(playerid, 3);
        PutPlayerInVehicle(playerid, 411, 0);
        CreateDynamicCheckPoint(....);
    }
    return 1;
}



Re: How to use checkpoints - manchestera - 01.11.2011

HI there i ust tried your quide but when i add it to my GM it just crashes the complier any ideas why?

http://pastebin.com/0UeG4jiz


Re: How to use checkpoints - bartje01 - 04.11.2011

Quote:
Originally Posted by Wesley221
View Post
Tutorial about what? Currencly almost done with this one, but no idea about what my next will be
Thanks for the tutorial. It's great even though I still have problems :P
I'll fix it sooner or later.


Suggestion:

You should make a dynamic business system

/buybus
/sellbus
/enterbus
/exitbus


And every hour you'll get some money based on the price of the business.


Re: How to use checkpoints - Wesley221 - 04.11.2011

Quote:
Originally Posted by manchestera
Посмотреть сообщение
HI there i ust tried your quide but when i add it to my GM it just crashes the complier any ideas why?

http://pastebin.com/0UeG4jiz
This is not a copy-paste tutorial, try to read it and try again. If you got problems with errors just post that, but you should give it some time before asking for help


Re: How to use checkpoints - Mr_Scripter - 07.11.2011

can you update it and add a tut of a job
when you enter check it gives you "Object in hand" and gives other Cp to take the "Object" to next cp \
thanks
btw nice tut


Re : How to use checkpoints - mehdi-jumper - 09.12.2011

Very good tuto Thanks, I'll use it to make driving license and flying license

Give[rep]=++

Thank you and continue to make tutoral like that!


Re: How to use checkpoints - §с†¶e®РµРe - 09.12.2011

Very nice