Otiy
-
Posts
94 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
News
Documentation
Posts posted by Otiy
-
-
nu merge sa il descarc
-
Salut, am si eu o problema cu /invite. Cand un leader da /invite playerul poate sa isi ia orice skin de ex: Leaderul il invita in Barzini Family si ii apare orice skin pe care il poate lua. Ce trebuie sa fac? [pawn]if(strcmp(cmd, "/invite", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /invite [playerid/PartOfName]");
return 1;
}
new para1;
new ftext[20];
para1 = ReturnUser(tmp);
if (PlayerInfo[playerid][pLeader] >= 1)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if (gTeam[para1]==TEAM_GREEN && PlayerInfo[para1][pMember] == 0 && PlayerInfo[para1][pFMember] == 255)
{
if(PlayerInfo[para1][pPunish] > 0)
{
SendClientMessage(playerid, COLOR_GRAD2, " Can't invite him, player have FactionPunish !");
return 1;
}
if(PlayerInfo[playerid][pLeader] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Police Force"; ChosenSkin[para1] = 265; SetPlayerSkin(para1, 265); }
else if(PlayerInfo[playerid][pLeader] == 2) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "FBI/ATF"; ChosenSkin[para1] = 286; SetPlayerSkin(para1, 286); }
else if(PlayerInfo[playerid][pLeader] == 3) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "National Guard"; ChosenSkin[para1] = 285; SetPlayerSkin(para1, 285); }
else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[para1][pTeam] = 1; gTeam[para1] = 1; ftext = "Firemen/Ambulance"; ChosenSkin[para1] = 228; SetPlayerSkin(para1, 228); }
else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Cuneo"; ChosenSkin[para1] = 111; SetPlayerSkin(para1, 111); }
else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[para1][pTeam] = 6; gTeam[para1] = 6; ftext = "Corleone"; ChosenSkin[para1] = 113; SetPlayerSkin(para1, 113); }
else if(PlayerInfo[playerid][pLeader] == 7) { return 1; }
else if(PlayerInfo[playerid][pLeader] == 8) { PlayerInfo[para1][pTeam] = 10; gTeam[para1] = 12; ftext = "Hitman Agency"; ChosenSkin[para1] = 294; SetPlayerSkin(para1, 294); }
else if(PlayerInfo[playerid][pLeader] == 9) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "ABC Studio"; ChosenSkin[para1] = 227; SetPlayerSkin(para1, 227); }
else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Taxi Cab Company"; ChosenSkin[para1] = 61; SetPlayerSkin(para1, 61); }
else if(PlayerInfo[playerid][pLeader] == 11) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "School Instructors"; ChosenSkin[para1] = 171; SetPlayerSkin(para1, 171); }
else if(PlayerInfo[playerid][pLeader] == 12) { PlayerInfo[para1][pTeam] = 15; gTeam[para1] = 15; ftext = "Barzini Family"; ChosenSkin[para1] = 270; SetPlayerSkin(para1, 270); }
else if(PlayerInfo[playerid][pLeader] == 13) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Tattaglia Family"; ChosenSkin[para1] = 126; SetPlayerSkin(para1, 126); }
else if(PlayerInfo[playerid][pLeader] == 14) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Paterno Family"; ChosenSkin[para1] = 296; SetPlayerSkin(para1, 296); }
else if(PlayerInfo[playerid][pLeader] == 15) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Stracci"; ChosenSkin[para1] = 272; SetPlayerSkin(para1, 272); }
else if(PlayerInfo[playerid][pLeader] == 16) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 5; ftext = "Tow Car Company"; ChosenSkin[para1] = 268; SetPlayerSkin(para1, 268); }
else { return 1; }
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pMember] = PlayerInfo[playerid][pLeader];
PlayerInfo[para1][pRank] = 1;
PlayerInfo[para1][pFwarn] = 0;
printf("AdmCmd: %s has invited %s to join %s.", sendername, giveplayer, ftext);
format(string, sizeof(string), " You have Joined the %s, you were invited by Leader %s", ftext, sendername);
SendClientMessage(para1, COLOR_WHITE, string);
format(string, sizeof(string), " You have Invited %s to join the %s.", giveplayer,ftext);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is currently Wanted/a Different Team/or already a Family Member.");
return 1;
}
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command(leaders only)!");
}
}
return 1;
}[/pawn]
-
Zicetimi si mie cum fac sa se salveze tuningul dupa /park. Uitati comanda [pawn]if(strcmp(cmd, "/park", true) == 0) // Seba97
{
{
if(gPlayerLogged[playerid] == 1)
{
if(IsPlayerConnected(playerid))
{
new Float:x,Float:y,Float:z;
new Float:a;
new carid;
new getcarid;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
else { return 1; }
getcarid = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, playername, sizeof(playername));
GetVehiclePos(carid, x, y, z);
//GetPlayerFacingAngle(playerid, a);
GetVehicleZAngle(carid, a);
if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
{
if(PlayerInfo[playerid][pPcarkey] == 999)
{
SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");
return 1;
}
if(getcarid == carid)
{
CarInfo[carid][cLocationx] = x;
CarInfo[carid][cLocationy] = y;
CarInfo[carid][cLocationz] = z;
CarInfo[carid][cAngle] = a;
format(string, sizeof(string), "~n~ Car Parked ~n~");
GameTextForPlayer(playerid, "You have parked your vehicle in this position. It will respawn here.", 10000, 3);
OnPropUpdate();
OnPlayerUpdateEx(playerid);
DestroyVehicle(carid);
CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
TogglePlayerControllable(playerid, 1);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not driving your car");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You need to login to use this command");
return 1;
}
}
}
return 1;
}[/pawn]
-
Si cum fac sa primeasca proprietarul CNN LV sa primeasca bani? Ca cel de la CNN LS ii primeste
-
Cum fac /ad pentru CNN LV si LS? Sa mearga la amandoua /ad nu /adls sau /adlv ce trb sa fac?
-
ma ajuta cineva?
-
ce cale? zimio si mie prin pm
-
Am mai adaugat ceva masini personale in cars.cfg si am modificat in gm la new CarInfo[333][cInfo]; si acuma nu merge sa dau /v buy si celelalte comenzi ce fac?
-
va rog ajutatima
-
Cum pun server-ul pe mysql?
-
poate avea 3 masini
-
cum fac sa ii dea direct?
-
Am o problema cu /v lock cand playerul scrie comanda merge zice ca e blocata masina dar nu este si cand dau /lock se blocheaza
Comanda /v lock
[pawn]else if(strcmp(x_nr,"lock",true) == 0)
{
new keycar = PlayerInfo[playerid][pPcarkey];
new carkey = PlayerInfo[playerid][pPcarkey];
if(keycar != 999)
{
new locked[256];
locked = strtok(cmdtext, idx);
if(CarInfo[keycar][cLock] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,0);
}
}
format(string, sizeof(string), "~w~%s ~g~Unlocked",CarInfo[carkey][cDescription]);
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 0;
OnPropUpdate();
return 1;
}
else if(CarInfo[keycar][cLock] == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,1);
}
}
format(string, sizeof(string), "~w~%s ~r~Locked",CarInfo[carkey][cDescription]);
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 1;
OnPropUpdate();
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't have a vehicle at slot 1");
return 1;
}
}
else if(strcmp(x_nr,"lock2",true) == 0)
{
new keycar = PlayerInfo[playerid][pPcarkey2];
if(keycar != 999)
{
new locked[256];
locked = strtok(cmdtext, idx);
if(CarInfo[keycar][cLock] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,0);
}
}
format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 0;
OnPropUpdate();
return 1;
}
else if(CarInfo[keycar][cLock] == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,1);
}
}
format(string, sizeof(string), "~w~Vehicle~n~~r~Locked");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 1;
OnPropUpdate();
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't have a vehicle at slot 2");
return 1;
}
}
else if(strcmp(x_nr,"lock3",true) == 0)
{
new keycar = PlayerInfo[playerid][pPcarkey3];
if(keycar != 999)
{
new locked[256];
locked = strtok(cmdtext, idx);
if(CarInfo[keycar][cLock] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,0);
}
}
format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 0;
OnPropUpdate();
return 1;
}
else if(CarInfo[keycar][cLock] == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,1);
}
}
format(string, sizeof(string), "~w~Vehicle~n~~r~Locked");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 1;
OnPropUpdate();
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't have a vehicle at slot 3");
return 1;
}
}[/pawn]
/lock
[pawn]if(strcmp(cmd, "/lock", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new carid;
if (gTeam[playerid] == 2 || gTeam[playerid] == 1)
{
if(gLastCar[playerid] == 0 && PlayerInfo[playerid][pPcarkey] == 999)
{
SendClientMessage(playerid, COLOR_GRAD2, " You dont have a Vehicle.");
return 1;
}
else if(gLastCar[playerid] != 0 && gLastCar[playerid] != PlayerInfo[playerid][pPcarkey])
{
if (HireCar[playerid] != gLastCar[playerid] && HireCar[playerid] != 299)
{
gLastDriver[HireCar[playerid]] = 300;
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
}
HireCar[playerid] = gLastCar[playerid];
}
}
if (PlayerInfo[playerid][pPcarkey] == 999)
{
if(HireCar[playerid] == 299)
{
SendClientMessage(playerid, COLOR_GRAD2, " You dont have a Vehicle.");
return 1;
}
}
carid = PlayerInfo[playerid][pPcarkey];
if(HireCar[playerid] != 299 && !SwitchKey[playerid])
{
carid = HireCar[playerid];
}
//new driver = gLastDriver[carid];
new lockstatus = gCarLock[carid];
new Float:cx,Float:cy,Float:cz;
GetVehiclePos(carid, cx, cy, cz);
switch (lockstatus)
{
case 0:
{
if(HireCar[playerid] == 299 && PlayerInfo[playerid][pPcarkey] == 999)
{
SendClientMessage(playerid, COLOR_GRAD2, " You dont have a Vehicle");
return 1;
}
if(HireCar[playerid] == carid && !SwitchKey[playerid])
{
GameTextForPlayer(playerid, "~w~Hire Vehicle ~r~Locked", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 1;
LockCar(carid);
}
else if (PlayerInfo[playerid][pPcarkey] == carid)
{
GameTextForPlayer(playerid, "~w~Your personal car has been ~r~Locked", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 1;
LockCar(carid);
return 1;
}
}
case 1:
{
if(HireCar[playerid] == 299 && PlayerInfo[playerid][pPcarkey] == 999)
{
SendClientMessage(playerid, COLOR_GRAD2, " You dont have a Vehicle");
return 1;
}
if(HireCar[playerid] == carid && !SwitchKey[playerid])
{
GameTextForPlayer(playerid, "~w~Hire Vehicle ~g~Unlocked", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 0;
UnLockCar(carid);
}
if (PlayerInfo[playerid][pPcarkey] == carid)
{
GameTextForPlayer(playerid, "~w~Your personal car has been ~g~Unlocked", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 0;
UnLockCar(carid);
return 1;
}
}
default:
{
SendClientMessage(playerid, COLOR_GRAD2, " Error");
}
}
if(carid == 999)
{
SendClientMessage(playerid, COLOR_GRAD2, " You dont have a Vehicle !");
}
}
return 1;
}[/pawn]
-
[pawn]if(strcmp(x_job,"car",true) == 0)
{
if(CarOffer[playerid] < 999)
{
if(IsPlayerConnected(CarOffer[playerid]))
{
if(GetPlayerCash(playerid) > CarPrice[playerid])
{
if(IsPlayerInVehicle(CarOffer[playerid], CarID[playerid]))
{
GetPlayerName(CarOffer[playerid], giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new points;
PlayerInfo[CarOffer[playerid]][pCarSkill] ++;
if(PlayerInfo[CarOffer[playerid]][pCarSkill] == 50)
{ SendClientMessage(CarOffer[playerid], COLOR_YELLOW, "* Your Car Dealer Skill is now Level 2, Players that buy Cars from you can call it more often."); }
else if(PlayerInfo[CarOffer[playerid]][pCarSkill] == 100)
{ SendClientMessage(CarOffer[playerid], COLOR_YELLOW, "* Your Car Dealer Skill is now Level 3, Players that buy Cars from you can call it more often."); }
else if(PlayerInfo[CarOffer[playerid]][pCarSkill] == 200)
{ SendClientMessage(CarOffer[playerid], COLOR_YELLOW, "* Your Car Dealer Skill is now Level 4, Players that buy Cars from you can call it more often."); }
else if(PlayerInfo[CarOffer[playerid]][pCarSkill] == 400)
{ SendClientMessage(CarOffer[playerid], COLOR_YELLOW, "* Your Car Dealer Skill is now Level 5, Players that buy Cars from you can call it more often."); }
new level = PlayerInfo[CarOffer[playerid]][pCarSkill];
if(level >= 0 && level <= 50) { points = 1; }
else if(level >= 51 && level <= 100) { points = 2; }
else if(level >= 101 && level <= 200) { points = 3; }
else if(level >= 201 && level <= 400) { points = 4; }
else if(level >= 401) { points = 4; }
format(string, sizeof(string), "* You bought a Car for $%d, from Car Dealer %s. (You can use /callcar %d times)",CarPrice[playerid],giveplayer,points);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* You sold your Car to %s for $%d, the player can use /callcar %d times.",sendername,CarPrice[playerid],points);
SendClientMessage(CarOffer[playerid], COLOR_WHITE, string);
PlayerInfo[CarOffer[playerid]][pPayCheck] += CarPrice[playerid] * 5;
GivePlayerCash(playerid, -CarPrice[playerid]);
RemovePlayerFromVehicle(CarOffer[playerid]);
CarCalls[playerid] = points;
CarOffer[playerid] = 999;
CarPrice[playerid] = 0;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " The Car Dealer is not in the offerd Car !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You cant afford the Car !");
return 1;
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " No-one offered to buy a Car !");
return 1;
}
}[/pawn]
-
Atunci cand un carjacker da sellcar nu ii da bani va rog ajutatima
[pawn]if(strcmp(cmd,"/sellcar",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] != 10)
{
SendClientMessage(playerid,COLOR_GREY," You are not a Car Dealer !");
return 1;
}
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid,COLOR_GREY," You are not in a Car !");
return 1;
}
if(IsAnOwnableCar(idcar))
{
SendClientMessage(playerid,COLOR_GREY," Use /v sellto to sell you car to other person !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sellcar [playerid/PartOfName] [price]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sellcar [playerid/PartOfName] [price]");
return 1;
}
new money = strval(tmp);
if(money < 1 || money > 6000000) { SendClientMessage(playerid, COLOR_GREY, " Price not below $1 or above &6000000 !"); return 1; }
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GREY, " Cant sell to yourself!");
return 1;
}
if(CarCalls[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " That player has already bought a car, has to use /callcar first !");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You offerd %s to buy your Car for $%d .", giveplayer, money);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Car Dealer %s wants to sell you his Car for $%d, (type /accept car) to buy.", sendername, money);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
CarOffer[giveplayerid] = playerid;
CarPrice[giveplayerid] = money;
CarID[giveplayerid] = GetPlayerVehicleID(playerid);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is not near you !");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Invalid ID/Name !");
return 1;
}
}
return 1;
}[/pawn]
acesta este codu sellcar
-
Am o problema cu carplate. cand dau myplate si dupa un RR se salveaza decat prima litera din cuvat. Puteti sa imi dai o comanda ceva? folosesc sistemul v buy, v sell etc
-
Multumesc
-
[pawn]public PayDay()
{
new string[128];
new account,interest;
new rent = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[pLevel] > 0)
{
if(MoneyMessage==1)
{
SendClientMessage(i, COLOR_LIGHTRED, "You failed to pay your debt, Jail time.");
GameTextForPlayer(i, "~r~Busted!", 2000, 1);
SetPlayerInterior(i, 6);
PlayerInfo[pInt] = 6;
SetPlayerPos(i, 264.6288,77.5742,1001.0391);
PlayerInfo[pJailed] = 1;
SafeResetPlayerWeapons(i);
ResetPlayerCash(i);
WantedPoints = 0;
PlayerInfo[pJailTime] = 240;
format(string, sizeof(string), "You are jailed for %d seconds. Bail: Unable", PlayerInfo[pJailTime]);
SendClientMessage(i, COLOR_WHITE, string);
}
new playername2[MAX_PLAYER_NAME];
GetPlayerName(i, playername2, sizeof(playername2));
account = PlayerInfo[pAccount];
new key = PlayerInfo[pPhousekey];
if(key != 255)
{
rent = HouseInfo[key][hRent];
if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
rent = 0;
}
else if(rent > GetPlayerCash(i))
{
PlayerInfo[pPhousekey] = 255;
SendClientMessage(i, COLOR_WHITE, "You have been evicted.");
rent = 0;
}
HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
}
new tmpintrate;
if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
if(PlayerInfo[pDonateRank] > 0) { tmpintrate = intrate+4; }
else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel]
}
else
{
if(PlayerInfo[pDonateRank] > 0) { tmpintrate = 3; }
else { tmpintrate = 1; }
}
if(PlayerInfo[pPayDay] >= 5)
{
Tax += TaxValue;//Should work for every player online
PlayerInfo[pAccount] -= TaxValue;
new checks = PlayerInfo[pPayCheck] / 5;
if(PlayerInfo[pDonateRank] > 0)
{
new bonus = PlayerInfo[pPayCheck] / 10;
checks += bonus;
}
new ebill = (PlayerInfo[pAccount]/10000)*(PlayerInfo[pLevel]);
ConsumingMoney = 1;
GivePlayerCash(i, checks);
//account += checks;
if(PlayerInfo[pAccount] > 0)
{
PlayerInfo[pAccount] -= ebill;
SBizzInfo[4][sbTill] += ebill;
}
else
{
ebill = 0;
}
interest = (PlayerInfo[pAccount]/1000)*(tmpintrate);
PlayerInfo[pExp]++;
PlayerPlayMusic(i);
PlayerInfo[pAccount] = account+interest;
SendClientMessage(i, COLOR_GREEN, "|___ BANK STATMENT ___|");
format(string, sizeof(string), " Paycheck: $%d", checks);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), " Tax Money: -$%d Rent: -$%d", TaxValue, rent);
SendClientMessage(i, COLOR_WHITE, string);
if(PlayerInfo[pPhousekey] != 255 || PlayerInfo[pPbiskey] != 255)
{
format(string, sizeof(string), " Electricity Bill: -$%d", ebill);
SendClientMessage(i, COLOR_GRAD1, string);
}
format(string, sizeof(string), " Balance: $%d", account - checks);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), " Interest Rate: 0.%d percent",tmpintrate);
SendClientMessage(i, COLOR_GRAD2, string);
format(string, sizeof(string), " Interest Gained $%d", interest);
SendClientMessage(i, COLOR_GRAD3, string);
SendClientMessage(i, COLOR_GREEN, "|--------------------------------------|");
format(string, sizeof(string), " New Balance: $%d", PlayerInfo[pAccount]);
SendClientMessage(i, COLOR_GRAD5, string);
format(string, sizeof(string), "~y~PayDay~n~~w~Check paid into your account");
GameTextForPlayer(i, string, 5000, 1);
rent = 0;
PlayerInfo[pPayDay] = 0;
PlayerInfo[pRob] += 2;
PlayerInfo[pPayCheck] = 0;
PlayerInfo[pConnectTime] += 1;
if(FarmerVar == 0)
{
FarmerPickup[0] = 0;
}
if(DrugFarmerVar == 0)
{
DrugFarmerPickup[0] = 0;
}
if(SmugglerWork == 0)
{
PayDaySecure = 0;
}
if(PlayerInfo[pMember] == 16 || PlayerInfo[pLeader] == 16)
{
PlayerInfo[pTow] += 5;
}
if(PlayerInfo[pDonateRank] > 0)
{
PlayerInfo[pPayDayHad] += 1;
if(PlayerInfo[pPayDayHad] >= 5)
{
PlayerInfo[pExp]++;
PlayerInfo[pPayDayHad] = 0;
}
}
if(PlayerInfo[pPunish] > 0)
{
PlayerInfo[pPunish] -= 1;
}
}
else
{
SendClientMessage(i, COLOR_WHITE, "* You haven't played long enough to obtain a PayDay.");
}
}
}
}
SaveAccounts();
Checkprop();
return 1;
}[/pawn]
-
Cum fac sa modific paydaY ca da ff putin da 900$ si eu vreau sa pun mai mult si daca faci un checkpoint scrie Added to your paycheck cum fac sa fie alt fel ca la b-zone de ex
-
Salut am si eu o problema. Atunci cand dau pay arata la toti asa "You have recieved %d$ from %s(ID: %d)." codul este:
[pawn] if(strcmp(cmd, "/pay", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /pay [playerid/PartOfName] [amount]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /pay [playerid/PartOfName] [amount]");
return 1;
}
moneys = strval(tmp);
if(moneys > 1000 && PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, "You must have level 3 to send money over 1.000");
return 1;
}
if(moneys < 1 || moneys > 50000)
{
SendClientMessage(playerid, COLOR_GRAD1, "Dont go below 1, or above 50.000 at once.");
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pLocal] == 106)
{
SendClientMessage(playerid, COLOR_GRAD1, "Command not allowed in this location");
return 1;
}
if (ProxDetectorS(5.0, playerid, giveplayerid))
{
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GREY, " You can not pay for yourself !");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerCash(playerid);
if (moneys > 0 && playermoney >= moneys)
{
//ConsumingMoney[giveplayerid] = 1;
if(paytime[playerid] == 1) return SendClientMessage(playerid, COLOR_GRAD2, "You can /pay once at 30 seconds.!");
GivePlayerCash(playerid, (0 - moneys));
GivePlayerCash(giveplayerid, moneys);
format(string, sizeof(string), "* You have sent %s(player: %d), $%d.", giveplayer,giveplayerid, moneys);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "You have recieved %d$ from %s(ID: %d).", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
/*format(string, sizeof(string), "%s has paid $%d to %s", sendername, moneys, giveplayer);*/
PayLog(string);
paytime[playerid] = 1;
SetTimerEx("pay", 1, 0, "%d", playerid);
if(moneys >= 1)
{
ABroadCast(COLOR_LIGHTRED,string,1);
}
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "* %s takes out some cash, and hands it to %s.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ApplyAnimation(playerid,"DEALER","shop_pay",4.1,0,0,0,0,0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Invalid transaction amount.");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Your too far away.");
}
}//invalid id
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}[/pawn]
-
da dar daca pun [pawn]public LoadCar()
{
new arrCoords[13][64];
new strFromFile2[256];
new File: file = fopen("carss.cfg", io_read);
if (file)
{
new idx = 184;
while (idx < sizeof(CarInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
CarInfo[idx][cModel] = strval(arrCoords[0]);
CarInfo[idx][cLocationx] = floatstr(arrCoords[1]);
CarInfo[idx][cLocationy] = floatstr(arrCoords[2]);
CarInfo[idx][cLocationz] = floatstr(arrCoords[3]);
CarInfo[idx][cAngle] = floatstr(arrCoords[4]);
CarInfo[idx][cColorOne] = strval(arrCoords[5]);
CarInfo[idx][cColorTwo] = strval(arrCoords[6]);
strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255);
strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255);
CarInfo[idx][cValue] = strval(arrCoords[9]);
strmid(CarInfo[idx][cLicense], arrCoords[10], 0, strlen(arrCoords[10]), 256);
//strmid(CarInfo[idx][cLicense], arrCoords[10], 0, strlen(arrCoords[10]), 255);
CarInfo[idx][cOwned] = strval(arrCoords[11]);
CarInfo[idx][cLock] = strval(arrCoords[12]);
printf("CarInfo: %d Owner:%s LicensePlate %s",idx,CarInfo[idx][cOwner],CarInfo[idx][cLicense]);
idx++;
}
}
return 1;
}
public SaveCarCoords()
{
new idx = 184;
new File: file2;
while (idx < sizeof(CarInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%d|%f|%f|%f|%f|%d|%d|%s\n",
CarInfo[idx][cModel],
CarInfo[idx][cLocationx],
CarInfo[idx][cLocationy],
CarInfo[idx][cLocationz],
CarInfo[idx][cAngle],
CarInfo[idx][cColorOne],
CarInfo[idx][cColorTwo]);
if(idx == 0)
{
file2 = fopen("carss.cfg", io_write);
}
else
{
file2 = fopen("carss.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
return 1;
}[/pawn]
imi da eroare
-
da dar eu vreau sa adaug si masinile din carss.cfg cum fac?
-
strmid(PlayerInfo[giveplayerid][pTBanned],timp, 0, strlen(timp),255); unde il pun?
-
[pawn]public LoadCar()
{
new arrCoords[13][64];
new strFromFile2[256];
new File: file = fopen("cars.cfg", io_read);
if (file)
{
new idx = 184;
while (idx < sizeof(CarInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
CarInfo[idx][cModel] = strval(arrCoords[0]);
CarInfo[idx][cLocationx] = floatstr(arrCoords[1]);
CarInfo[idx][cLocationy] = floatstr(arrCoords[2]);
CarInfo[idx][cLocationz] = floatstr(arrCoords[3]);
CarInfo[idx][cAngle] = floatstr(arrCoords[4]);
CarInfo[idx][cColorOne] = strval(arrCoords[5]);
CarInfo[idx][cColorTwo] = strval(arrCoords[6]);
strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255);
strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255);
CarInfo[idx][cValue] = strval(arrCoords[9]);
strmid(CarInfo[idx][cLicense], arrCoords[10], 0, strlen(arrCoords[10]), 256);
//strmid(CarInfo[idx][cLicense], arrCoords[10], 0, strlen(arrCoords[10]), 255);
CarInfo[idx][cOwned] = strval(arrCoords[11]);
CarInfo[idx][cLock] = strval(arrCoords[12]);
printf("CarInfo: %d Owner:%s LicensePlate %s",idx,CarInfo[idx][cOwner],CarInfo[idx][cLicense]);
idx++;
}
}
return 1;
}
public SaveCarCoords()
{
new idx = 184;
new File: file2;
while (idx < sizeof(CarInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%d|%f|%f|%f|%f|%d|%d|%s\n",
CarInfo[idx][cModel],
CarInfo[idx][cLocationx],
CarInfo[idx][cLocationy],
CarInfo[idx][cLocationz],
CarInfo[idx][cAngle],
CarInfo[idx][cColorOne],
CarInfo[idx][cColorTwo]);
if(idx == 0)
{
file2 = fopen("cars.cfg", io_write);
}
else
{
file2 = fopen("cars.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
return 1;
}[/pawn]
uite ce fac vreau sa adaug si fisieru carss.cfg
Problema /rob
in Arhivă probleme
Posted
Am si eu o problema cu /rob. Cand cineva da /rob ii da wanted 3 in loc de 6 ce trebuie sa fac? [pawn]if(strcmp(cmd, "/rob", true) == 0)
{
if(PlayerInfo[playerid][pRob] >= 15)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInVehicle(playerid, 176))
{
if(PlayerToPoint(30.0, playerid,1460.9639, -1022.6666, 23.8281))
{
if(robtime[playerid] == 1) return SendClientMessage(playerid, COLOR_GRAD2, "You need to wait 5 minutes!");
WantedPoints[playerid] = 6; SetPlayerCriminal(playerid,255, "Robbing a Bank");
GameTextForPlayer(playerid, "~r~Ai jefuit banca", 2500, 1);
SetPlayerWantedLevel(playerid, 6);
CP[playerid] = 51;
SetPlayerCheckpoint(playerid, 2379.7356,-2015.2886,14.9519, 3.0);
BizzInfo[4][bProducts] -= 25;
robtime[playerid] = 1;
SetTimerEx("robreset", 300000, 0, "%d", playerid);
new pName[24];
new str[128];
GetPlayerName(playerid, pName, 24);
format(str, 128,"[HOT NEWS] Banca a fost jefuita de %s, toate unitatile in alerta !", pName);
SendClientMessageToAll(COLOR_ORANGE, str);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not at the Bank !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY," You are not in the black van !");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY," You are not able to rob the Bank now !");
RemovePlayerFromVehicle(playerid);
return 1;
}
}[/pawn]