09.12.2010, 21:28
Hy everyone. I have a big problem with some commands. Example : /lock, /rentatv, /lock etc.
Someone told me about this problem occurs because I have too many cars on server. I use GermanLife CarOwnerShip or something like that. So i have 380 cars + 1000-1500 personal cars.
How can I solve this problem? Should I use a streamer for cars?
Thank for help and sorry for my bad english.
Someone told me about this problem occurs because I have too many cars on server. I use GermanLife CarOwnerShip or something like that. So i have 380 cars + 1000-1500 personal cars.
How can I solve this problem? Should I use a streamer for cars?
Thank for help and sorry for my bad english.
Код:
if(strcmp(cmd, "/lock", true) == 0) { if(IsPlayerConnected(playerid)) { new carid; if (gTeam[playerid] == 2 || gTeam[playerid] == 1) { if(gLastCar[playerid] == 0 && PlayerInfo[playerid][pPhousekey] == 255) { SendClientMessage(playerid, COLOR_GRAD2, " You dont have a Vehicle."); return 1; } else if(gLastCar[playerid] != 0 && gLastCar[playerid] != PlayerInfo[playerid][pPhousekey]+1) { 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][pPhousekey] == 255) { if(HireCar[playerid] == 299) { SendClientMessage(playerid, COLOR_GRAD2, " You dont have a Vehicle."); return 1; } } carid = PlayerInfo[playerid][pPhousekey]+1; 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][pPhousekey] == 255) { 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][pPhousekey] == carid-1) { GameTextForPlayer(playerid, "~w~House Vehicle ~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][pPhousekey] == 255) { 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][pPhousekey] == carid-1) { GameTextForPlayer(playerid, "~w~House Vehicle ~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 == 256) { SendClientMessage(playerid, COLOR_GRAD2, " You dont have a Vehicle !"); } } return 1; }
Код:
if(strcmp(cmd, "/open", true) == 0) { if(IsPlayerConnected(playerid)) { for(new i = 0; i < sizeof(HouseInfo); i++) { if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]) || PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz])) { if(PlayerInfo[playerid][pPhousekey] == i) { if(HouseInfo[i][hLock] == 1) { HouseInfo[i][hLock] = 0; GameTextForPlayer(playerid, "~w~Door ~g~Unlocked", 5000, 6); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); return 1; } if(HouseInfo[i][hLock] == 0) { HouseInfo[i][hLock] = 1; GameTextForPlayer(playerid, "~w~Door ~r~Locked", 5000, 6); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); return 1; } } else { GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6); return 1; } } } for(new i = 0; i < sizeof(BizzInfo); i++) { if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]) || PlayerToPoint(3, playerid,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ])) { if(PlayerInfo[playerid][pPbiskey] == i) { if(BizzInfo[i][bLocked] == 1) { BizzInfo[i][bLocked] = 0; GameTextForPlayer(playerid, "~w~Bussiness ~g~Open", 5000, 6); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); return 1; } if(BizzInfo[i][bLocked] == 0) { BizzInfo[i][bLocked] = 1; GameTextForPlayer(playerid, "~w~Bussiness ~r~Closed", 5000, 6); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); return 1; } } else { GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6); return 1; } } } for(new i = 0; i < sizeof(SBizzInfo); i++) { if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ])) { if(PlayerInfo[playerid][pPbiskey] == i+100) { if(SBizzInfo[i][sbLocked] == 1) { SBizzInfo[i][sbLocked] = 0; GameTextForPlayer(playerid, "~w~Bussiness ~g~Open", 5000, 6); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); return 1; } if(SBizzInfo[i][sbLocked] == 0) { SBizzInfo[i][sbLocked] = 1; GameTextForPlayer(playerid, "~w~Bussiness ~r~Closed", 5000, 6); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); return 1; } } else { GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6); return 1; } } } } return 1; }
Код:
if(strcmp(cmd, "/rentatv", true) == 0) { if(IsPlayerConnected(playerid)) { if(GetPlayerVehicleID(playerid) >= 390 && GetPlayerVehicleID(playerid) <= 394) { new hirefee = HireCost(GetPlayerVehicleID(playerid)); if(GetPlayerVehicleID(playerid) >= 390 && GetPlayerVehicleID(playerid) <= 394) { if(SBizzInfo[16][sbProducts] == 0) { GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1); return 1; } if(PlayerInfo[playerid][pPbiskey] == 16) { GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3); TogglePlayerControllable(playerid, 1); return 1; } if (GetPlayerCash(playerid) < SBizzInfo[16][sbEntranceCost]) { SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much cash !"); return 1; } GivePlayerCash(playerid,-SBizzInfo[16][sbEntranceCost]); SBizzInfo[16][sbTill] += SBizzInfo[16][sbEntranceCost]; ExtortionSBiz(16, SBizzInfo[16][sbEntranceCost]); SBizzInfo[16][sbProducts]--; } if(HireCar[playerid] != 299) { gCarLock[HireCar[playerid]] = 0; UnLockCar(HireCar[playerid]); } HireCar[playerid] = GetPlayerVehicleID(playerid); OnPropUpdate(); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); format(string, sizeof(string), "~g~~h~~h~succeseful~n~~w~this atv is you~n~~w~use ~r~~h~/lock ~w~to lock him",hirefee); TogglePlayerControllable(playerid, 1); GameTextForPlayer(playerid, string, 3000, 3); } } return 1; }