16.12.2010, 12:54
Ok i wanted to make a sallary, but it still doesnt give money to a player.
This is somewhere under OnPlayerEnterVehicle
I put this into the back of the gamemode. (This checks the model of the vehicle the player is in and gives the specified amount of money).
Well i drive one of those vehicles and i dont get any money. Wheres the problem?
Код:
forward Sallary(playerid);
Код:
new model = GetVehicleModel(vehicleid); new spec = playerDB[playerid][specialybe]; if(model== 597 || model== 523 || model== 430 || model== 599 || model== 497) { if(playerDB[playerid][admin] || spec == 1) { SendClientMessage(playerid,0xD9E916FF,"* Text text you will get money bla bla bla !"); SetTimerEx("Sallary", 1000, true, "i", playerid); /// Dont mind the time, its just for testing return 1; } ShowPlayerDialog(playerid, 2001, DIALOG_STYLE_MSGBOX,"Job", "You are not working in the right job", "Ok", "Next"); Stop(playerid); return 1; }
Код:
public Sallary() { for(new playerid;playerid<MAX_PLAYERS;playerid++) { if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return; new vehicleid = GetPlayerVehicleID(playerid); new model = GetVehicleModel(vehicleid); //Laikas sumoketi, ne? Puse minutes = puse algos. if(model == 598 || model == 597 || model == 523 || model == 599 || model == 427) playerDB[playerid][banke]+=45; else if(model == 544 || model == 416 || model == 489 || model == 505) playerDB[playerid][alga]+=55; else if(model == 538) playerDB[playerid][alga]+=25; else if(model == TOWTRUCK) playerDB[playerid][alga]+=35; else if(model == SWEEPER) playerDB[playerid][alga]+=50; else if(model == 524) playerDB[playerid][alga]+=40; else if(model == DOZER) playerDB[playerid][alga]+=25; else if(model == 421) playerDB[playerid][alga]+=45; else if(model == TAXI || model== 438) playerDB[playerid][alga]+=80; else if(model== 411) playerDB[playerid][alga]+=40; else if(model == 446 || model == 424 ) playerDB[playerid][alga]+=40; else if(model == NEWSVAN) playerDB[playerid][alga]+=55; else if(model == 448) playerDB[playerid][alga]+=50; else if(model == HOTDOG) playerDB[playerid][alga]+=55; else if(model == 502) playerDB[playerid][alga]+=150; else if(model == 516) playerDB[playerid][alga]+=50; else if(model == 552) playerDB[playerid][alga]+=65; else if(model == TUG) playerDB[playerid][alga]+=45; else if(model == MOWER) playerDB[playerid][alga]+=50; else if(model == 535) playerDB[playerid][alga]+=55; else if(model == 500) playerDB[playerid][alga]+=50;//ginklu dyleriai else if(model == 609 || model== 438) playerDB[playerid][alga]+=70; else if(model == 522 || model == 522) playerDB[playerid][alga]+=20; else if(model == 545 || model == 575 || model == 576 || model == 467 || model == 434) playerDB[playerid[alga]+=60; else if(model == NEVADA || model == SHAMAL || model == RUSTLER) playerDB[playerid][alga]+=45; else if(model == BAGGAGE) playerDB[playerid][alga]+=55; else if(model == WINDSOR) playerDB[playerid][alga]+=70; else if(model == 490) playerDB[playerid][alga]+=80; else if(model == HUNTLEY) playerDB[playerid][alga]+=70; else if(model == 479) playerDB[playerid][alga]+=50; // narkotiku dyleriai else if(model == 484 || model == 452) playerDB[playerid][alga]+=35; else if(model == 514 || model== 515 || model== 403) playerDB[playerid][alga]+=55; else if(model == 456) playerDB[playerid][alga]+=40; } }