07.12.2015, 21:33
1. How can I make a post office that's different for each user like a bank?
2. I'd like to set some checkpoint for each job and when the player go thourgh the last checkpoint the vehicle he has been using gets to its position and the money he earned will go into his own post account and he can't work on this job again per payday
My code about Pizza Boy Job (example)
Thanks guys really
2. I'd like to set some checkpoint for each job and when the player go thourgh the last checkpoint the vehicle he has been using gets to its position and the money he earned will go into his own post account and he can't work on this job again per payday
My code about Pizza Boy Job (example)
Код:
forward LoadPizzaBoy(); forward SavePizzaBoy();
Код:
enum PizzaBoyLocation { Float:X, Float:Y, Float:Z, World, Interior, Float:Angle, PickupID, }; new PizzaBoyPosition[PizzaBoyLocation];
Код:
public LoadScript() { LoadPizzaBoy(); }
Код:
else if(IsPlayerInAnyVehicle(playerid) && idcar >=14 && idcar<=18)//PizzaBoy { if(PlayerInfo[playerid][pJob] == 4) { CheckPointSpazzino[playerid] = 1; randomize = random(sizeof(gMissioneLavoriPunti)); SetPlayerCheckpoint(playerid, gMissioneLavoriPunti[randomize][0], gMissioneLavoriPunti[randomize][1], gMissioneLavoriPunti[randomize][2], 5.0); SendClientMessage(playerid, COLOR_WHITE, "You've started your job, go through checkpoints"); } }
Код:
else if(PlayerInfo[playerid][pJob] == 4) { if(PlayerToPoint(1.0, playerid,PizzaBoyPosition[X],PizzaBoyPosition[Y],PizzaBoyPosition[Z])) { SendClientMessage(playerid,0x04C4D9AA,"You're in duty, ride on bike and type /startjob"); JobDutyCars[playerid] = 4; SetPlayerSkin(playerid,155); } }
Код:
else if(PlayerToPoint(1.0, playerid,PizzaBoyPosition[X],PizzaBoyPosition[Y],PizzaBoyPosition[Z])) { if(GetPlayerVirtualWorld(playerid) == PizzaBoyPosition[World]) { if(PlayerInfo[playerid][pLevel] == 1) { SendClientMessage(playerid,0xff8212ff,"You're a pizza boy now, type /work to work"); PlayerInfo[playerid][pJob] = 4; //PizzaBoy SendClientMessage(playerid,COLOR_WHITE," /jobhelp to see new commands"); } else if(PlayerInfo[playerid][pLevel] > 1) { if(PlayerInfo[playerid][pLicenzaA] > 0) { SendClientMessage(playerid,0xff8212ff," You're a pizza boy now, type /work to work"); PlayerInfo[playerid][pJob] = 4; //PizzaBoy SendClientMessage(playerid,COLOR_WHITE," /jobhelp to see new commands"); } else { SendClientMessage(playerid,0xFF0000AA,"[PIZZABOY] You need driving license A to work as pizza boy"); return 1; } } } }
Код:
else if(newcar>=14 && newcar<=19) { //Pizza Boy if(JobDutyCars[playerid] == 4) { } else { SendClientMessage(playerid,COLOR_LIGHTBLUE, "You don't own vehicle keys"); RemoveDriverFromVehicle(playerid); } }
Код:
public OnPlayerEnterCheckpoint(playerid) { //INIZIO PIZZA new pizza; if(CheckPointSpazzino[playerid] == 1) pizza = pizza + 1; if(pizza == 11) { SetPlayerCheckpoint(playerid,1359.0188,252.3399,19.5669, 3); } if(pizza == 11) { if(PlayerToPoint(5.0,playerid, 1359.0188,252.3399,19.5669)) { SendClientMessage(playerid, 0x33CCFFAA, "Your work is over, we sent the money to your bank account"); CheckPointSpazzino[playerid] = 0; JobDutyCars[playerid] = 0; InizioLavoro[playerid] = 0; DisablePlayerCheckpoint(playerid); SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); } } }
Код:
public LoadPizzaBoy() { new arrCoords[7][64]; new strFromFile2[256]; new File: file = fopen("CRP_Scriptfiles/Jobs/PizzaBoy.cfg", io_read); if (file) { fread(file, strFromFile2); split(strFromFile2, arrCoords, '|'); PizzaBoyPosition[X] = floatstr(arrCoords[0]); PizzaBoyPosition[Y] = floatstr(arrCoords[1]); PizzaBoyPosition[Z] = floatstr(arrCoords[2]); PizzaBoyPosition[World] = strval(arrCoords[3]); PizzaBoyPosition[Interior] = strval(arrCoords[4]); PizzaBoyPosition[Angle] = floatstr(arrCoords[5]); PizzaBoyPosition[PickupID] = strval(arrCoords[6]); PizzaBoyPosition[PickupID] = CreateStreamPickup(1274,1,PizzaBoyPosition[X],PizzaBoyPosition[Y],PizzaBoyPosition[Z],PICKUP_RANGE); print("PizzaBoy Caricato"); } fclose(file); return 1; } public SavePizzaBoy() { new File: file2; new coordsstring[512]; format(coordsstring, sizeof(coordsstring), "%f|%f|%f|%d|%d|%f|%d\n", PizzaBoyPosition[X], PizzaBoyPosition[Y], PizzaBoyPosition[Z], PizzaBoyPosition[World], PizzaBoyPosition[Interior], PizzaBoyPosition[Angle], PizzaBoyPosition[PickupID]); file2 = fopen("CRP_Scriptfiles/Jobs/PizzaBoy.cfg", io_write); fwrite(file2, coordsstring); fclose(file2); return 1; }
Код:
else if(PlayerToPoint(1.0, i,PizzaBoyPosition[X],PizzaBoyPosition[Y],PizzaBoyPosition[Z])) { if(PlayerInfo[i][pJob] == 0) { GameTextForPlayer(i, "Work ~y~PizzaBoy~w~~n~/takejob", 3500, 3); } if(PlayerInfo[i][pJob] == 4) { GameTextForPlayer(i, "Work~y~PizzaBoy~w~~n~/work~n~/leavework", 3500, 3); } }