SA-MP Forums Archive
RolePlay Job scripts - 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: RolePlay Job scripts (/showthread.php?tid=521666)



RolePlay Job scripts - Bek_Loking - 24.06.2014

Hello. For last 7 months I've been amazed and fascinated by roleplay servers. and when a server on which I played Shut down, because of hacker group which managed to ruin the server and everything, I decided why not learn pawno. Now what I wanna learn, is how to make jobs. I have an idea in my mind but I'm not sure if it's any good, and if there is a better way. My idea is:

PHP Code:
new job[MAX_PLAYERS
PHP Code:
CMD:somejob(playeridparams[])
{
if(
job[playerid] = 1) return SendClientMessage(playeridcolor_red"You already have a job");
if(!
IsPlayerInRangeOfPoint(playeridrange,x,y,z)) return SendClientMessage(playeridcolor_red"You're not near blabla");
if(
IsPlayerInRangeOfPoint(playeridrange,x,y,z))
{
job[playerid] = 1;
SetPlayerCheckpoint(playeridcoords);
}
return 
1;

Thats my half- idea how to make a job. Now take in consideration that I'm very new to scripting so. Do not paste a code just explain how can I make one, with this my method


Re: RolePlay Job scripts - Amel_PAtomAXx - 24.06.2014

Scripting RolePlay script can take you even few years. You should first ask yourself are you ready for that challenge. And yeah, here's few useful tutorials for you.

https://sampforum.blast.hk/showthread.php?pid=2057748#pid2057748 - Squirrel
https://sampforum.blast.hk/showthread.php?pid=2614599#pid2614599 - cluckintucker
https://sampforum.blast.hk/showthread.php?pid=1950847#pid1950847 - WagnerPM


Re: RolePlay Job scripts - Bek_Loking - 24.06.2014

Oh well,I'm ready. What I wanted to ask you if this would be good?


Re: RolePlay Job scripts - Beckett - 24.06.2014

Your method is okay, you can use it to continue with your scripts with -jobs-.


Re: RolePlay Job scripts - Cena44 - 24.06.2014

Your method is correct when it comes to checking if the player has a job or not, but you didn't really actually give them a job, as you used "job" to determine if the player has a job or not, not which job they got.


Re: RolePlay Job scripts - Bek_Loking - 24.06.2014

Alright should I do it like this then:


PHP Code:
new employment[MAX_PLAYERS];
new 
job[MAX_PLAYERS]; 
PHP Code:
CMD:examplejobemployment
{
if(
employment[playerid] = 1)
{
SendClientMessage(playeridcolor"You're already employed!");
}
employment[playerid] = 1
SendClientMessage
(playeridcolor"Congratulations, you have employed yourself!");
return 
1;

PHP Code:
CMD:somejob(playeridparams[]) 

if(
job[playerid] = 1) return SendClientMessage(playeridcolor_red"You already have a job"); 
if(!
IsPlayerInRangeOfPoint(playeridrange,x,y,z)) return SendClientMessage(playeridcolor_red"You're not near blabla"); 
if(
IsPlayerInRangeOfPoint(playeridrange,x,y,z)) 

job[playerid] = 1
SetPlayerCheckpoint(playeridcoords); 

return 
1