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(playerid, params[])
{
if(job[playerid] = 1) return SendClientMessage(playerid, color_red, "You already have a job");
if(!IsPlayerInRangeOfPoint(playerid, range,x,y,z)) return SendClientMessage(playerid, color_red, "You're not near blabla");
if(IsPlayerInRangeOfPoint(playerid, range,x,y,z))
{
job[playerid] = 1;
SetPlayerCheckpoint(playerid, coords);
}
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(playerid, color, "You're already employed!");
}
employment[playerid] = 1
SendClientMessage(playerid, color, "Congratulations, you have employed yourself!");
return 1;
}
PHP Code:
CMD:somejob(playerid, params[])
{
if(job[playerid] = 1) return SendClientMessage(playerid, color_red, "You already have a job");
if(!IsPlayerInRangeOfPoint(playerid, range,x,y,z)) return SendClientMessage(playerid, color_red, "You're not near blabla");
if(IsPlayerInRangeOfPoint(playerid, range,x,y,z))
{
job[playerid] = 1;
SetPlayerCheckpoint(playerid, coords);
}
return 1;
}