RolePlay Job scripts
#1

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
Reply
#2

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
Reply
#3

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

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

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.
Reply
#6

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

Reply


Forum Jump:


Users browsing this thread: