26.06.2014, 12:28
Hey. As you can tell by the title it's about a code that should be Abuse-proof. What I made is:
These are under "new" what I have to define of course. Now the script is:
That's to employ himself/herself
Here's to do the job.
And to quit job:
I quite don't see that it can be bug-abused exploited or else, but I need your opinions, if you see that it's abusive tell me, so I can fix it right away. I found abusive parts but I did fix them.
---------------------------------------------------------------------------------------------------------------
Another question: How do I save that he is builder, that his job is builder, he has that much money and others? How do I save that, is there a filterscript for that or something?
---------------------------------------------------------------------------------------------------------------
PHP код:
new job[MAX_PLAYERS];
new employment[MAX_PLAYERS];
new builder[MAX_PLAYERS];
PHP код:
CMD:employbuilder(playerid, params[])
{
if(builder[playerid] == 1) SendClientMessage(playerid, COLOR_RED,"[ERROR]{FFFFFF}You're already employed as builder!");
else if(employment[playerid] == 1) SendClientMessage(playerid, COLOR_RED, "You already have a job!");
else if(!IsPlayerInRangeOfPoint(playerid,1895.7168,1729.1393,10.8153,5)) SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF}You're not at construction site");
else
{
SendClientMessage(playerid, COLOR_LIGHTGREEN, "[SUCCESS!]{FFFFFF}You've employed yourself as a builder!");
employment[playerid] = 1;
builder[playerid] = 1;
}
return 1;
}
Here's to do the job.
PHP код:
CMD:startjob(playerid, params[])
{
if(builder[playerid] == 0) SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF}You're not employed as builder!");
else if(job[playerid] == 1) SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF}You already have a job going!");
else if(!IsPlayerInRangeOfPoint(playerid, 5,1878.5900,1758.6154,10.4470)) SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF}You're not near construction site!");
{
job[playerid] = 1;
SendClientMessage(playerid, COLOR_LIGHTGREEN, "[SUCCESS!]{FFFFFF}You've started gathering resources. Go through checkpoints to finish your job!");
SetPlayerCheckpoint(playerid,1880.6528,1759.2567,10.1134,2);
}
return 1;
}
PHP код:
CMD:quitbuilders(splayerid, params[])
{
if(employment[playerid] == 0 || builder[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF}You're already unemployed!");
SendClientMessage(playerid, COLOR_RED, "You have quit builders. Good luck in new job!");
builder[playerid] = 0;
employment[playerid] = 0;
return 1;
}
I quite don't see that it can be bug-abused exploited or else, but I need your opinions, if you see that it's abusive tell me, so I can fix it right away. I found abusive parts but I did fix them.
---------------------------------------------------------------------------------------------------------------
Another question: How do I save that he is builder, that his job is builder, he has that much money and others? How do I save that, is there a filterscript for that or something?
---------------------------------------------------------------------------------------------------------------