08.02.2014, 14:49
Hello. Well, i've started this thread since i'm having some problems with my Job system. I'll explain it better:
I've been creating my own system for my Project, and well. Here some examples:
Defines and my Job Variable:
The variable usage:
(Sorry about the indentation).
Now, the problem's source (or not...)
Whatever job i pick, the payday just gives me the money of the lower jobs. No matter wich job do i pick, it will always send only the first one's payment.
If any of you scripters with more knowledge can help me, I really would appreciate it.
P.S: All those jobs are defined, I've just posted an example of it.
I've been creating my own system for my Project, and well. Here some examples:
Defines and my Job Variable:
Код:
new mJob[MAX_PLAYERS]; #define MAX_JOBS 33 #define JOBLESS 0 #define MECHANIC 1 #define TAXI 2 #define Plumber 3 #define Singer 4 #define Rapist 5 #define Kidnaper 6 #define Prostitute 7
Код:
if(dialogid == DIALOGID3+2) { if(response) { switch(listitem) { case 0: { mJob[playerid] = 1; dUserSetINT(PlayerName2(playerid)).("PJob",1); SendClientMessage(playerid, orange, "[INFO]:{95FF00}You're now working as Taxist! Type /Taxi and start having your passengers."); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); GivePlayerWeapon(playerid, 7, 1); SetPlayerSkin(playerid, 142); dUserSetINT(PlayerName2(playerid)).("FavSkin",142); } case 1: { mJob[playerid] = 2; dUserSetINT(PlayerName2(playerid)).("PJob",2); SendClientMessage(playerid, orange, "[INFO]:{95FF00}You're now working as Mechanic!"); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); GivePlayerWeapon(playerid, 15, 1); SetPlayerSkin(playerid, 50); dUserSetINT(PlayerName2(playerid)).("FavSkin",50); } case 2: { mJob[playerid] = 3; dUserSetINT(PlayerName2(playerid)).("PJob",3); SendClientMessage(playerid, orange, "[INFO]:{95FF00}You're now an Plumber!"); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); GivePlayerWeapon(playerid, 15, 1); SetPlayerSkin(playerid, 14); dUserSetINT(PlayerName2(playerid)).("FavSkin",14); } case 3: { mJob[playerid] = 4; dUserSetINT(PlayerName2(playerid)).("PJob",4); SendClientMessage(playerid, orange, "[INFO]:{95FF00}You're now working as Singer!"); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); GivePlayerWeapon(playerid, 11, 1); SetPlayerSkin(playerid, 297); dUserSetINT(PlayerName2(playerid)).("FavSkin",297); } case 4: { mJob[playerid] = 5; dUserSetINT(PlayerName2(playerid)).("PJob",5); SendClientMessage(playerid, orange, "[INFO]:{95FF00}You're now working as Rapist."); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); GivePlayerWeapon(playerid, 12, 1); SetPlayerSkin(playerid, 3); dUserSetINT(PlayerName2(playerid)).("FavSkin",3); } case 5: { mJob[playerid] = 6; dUserSetINT(PlayerName2(playerid)).("PJob",6); SendClientMessage(playerid, orange, "[INFO]:{95FF00}You're now working as Kidnaper."); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); GivePlayerWeapon(playerid, 4, 1); SetPlayerSkin(playerid, 3); dUserSetINT(PlayerName2(playerid)).("FavSkin",3); } case 6: { mJob[playerid] = 7; dUserSetINT(PlayerName2(playerid)).("PJob",7); SendClientMessage(playerid, orange, "[INFO]:{95FF00}You're now working as Prostitute."); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); GivePlayerWeapon(playerid, 10, 1); SetPlayerSkin(playerid, 246); dUserSetINT(PlayerName2(playerid)).("FavSkin",246); } } } }
Now, the problem's source (or not...)
Код:
public PayDay() { SendClientMessageToAll(COLOR_LIGHTBLUE,"[PROPERTY]: All property's earnings have been updated, and you got an rebate of $10k."); for (new i = 0; i < MAX_PLAYERS; i++) { if(mJob[i] == 1 || 2 || 3 || 4 || 5 || 6 || 7) { GivePlayerMoney(i, 700); PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0); SendClientMessage(i, COLOR_ORANGE, "[PayDay]: You has received $700 from your Job's money!"); } else if(mJob[i] == 8 || 9 || 10 || 11 || 12) { GivePlayerMoney(i, 1500); PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0); SendClientMessage(i, COLOR_ORANGE, "[PayDay]: You has received $1500 from your Job's money!"); } else if(mJob[i] == 13 || 14 || 15 || 16 || 17) { GivePlayerMoney(i, 5000); PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0); SendClientMessage(i, COLOR_ORANGE, "[PayDay]: You has received $5k from your Job's money!"); } else if(mJob[i] == 18 || 19 || 20 || 21 || 22) { GivePlayerMoney(i, 7800); PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0); SendClientMessage(i, COLOR_ORANGE, "[PayDay]: You has received $7800 from your Job's money!"); } else if(mJob[i] == 23 || 24 || 25 || 26 || 27) { GivePlayerMoney(i, 10000); PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0); SendClientMessage(i, COLOR_ORANGE, "[PayDay]: You has received $10k from your Job's money!"); } else if(mJob[i] == 28 || 29 || 30 || 31 || 32) { GivePlayerMoney(i, 30000); PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0); SendClientMessage(i, COLOR_ORANGE, "[PayDay]: You has received $30k from your Job's money!"); } if(PlayerInfo[i][bowner] == 1) { new cbmon = BizInfo[PlayerInfo[i][bowned]][cashbox], pmon = BizInfo[PlayerInfo[i][bowned]][profit]; BizInfo[PlayerInfo[i][bowned]][cashbox] = cbmon+pmon; SendClientMessage(i,COLOR_LIGHTBLUE,"To collect you business' earnings return to your business and type '/cashbox'"); } } }
If any of you scripters with more knowledge can help me, I really would appreciate it.
P.S: All those jobs are defined, I've just posted an example of it.