24.12.2008, 02:59
Quote:
Originally Posted by vortexxx
I need help about yakuza gang cars and i want to make that only users in the yakuza gang can enter those cars plss help
|
Code:
public IsAYakuzaCar(carid) { if (PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6) //Yakuza { new tmpcar = GetVehicleModel(carid); if(tmpcar==596 || tmpcar==598) <-- Change those Numbers to the Cars that yakuza can use only. { return 1; } } else { SendClientMessage(playerid, COLOR_YELLOW, "You are not member of the Yakuza Organisation!"); RemovePlayerFromVehicle(playerid); } return 0; }
put that code anywhere you want.
Also the
Code:
if(tmpcar==596 || tmpcar==598) <-- Change those Numbers to the Cars that yakuza can use only.
if you still don't understand PM me and i'll try to help ya out!
Now my problem:
Quote:
Hey everyone, i have a kind of a slight problem at the moment, my /rentcars command doesn't seem to work anymore, but it did before. The problem is that when i enter a rentcar(yes i have edited IsARentCar[Huh?] to 91-109) i can drive it without using /rentcars to trigger the SetPlayerControllable. Look this is my setup for the Rentcars Code: Code:
if(newcar >= 91 && newcar <= 98) { if (HireCar[playerid] != newcar) { format(string, sizeof(string), "~w~You can Rent this car~n~Cost:~g~$%d~n~~w~To rent type ~g~/rentcar~w~~n~to get out type ~r~/exit",SBizzInfo[0][sbEntranceCost]); TogglePlayerControllable(playerid, 0); GameTextForPlayer(playerid, string, 5000, 3); } } if(newcar >= 99 && newcar <= 109) { if (HireCar[playerid] != newcar) { format(string, sizeof(string), "~w~You can Rent this car~n~Cost:~g~$%d~n~~w~To rent type ~g~/rentcar~w~~n~to get out type ~r~/exit",SBizzInfo[1][sbEntranceCost]); TogglePlayerControllable(playerid, 0); GameTextForPlayer(playerid, string, 5000, 3); } } Code:
if(strcmp(cmd, "/rentcar", true) == 0) { if(IsPlayerConnected(playerid)) { if(GetPlayerVehicleID(playerid) >= 91 && GetPlayerVehicleID(playerid) <= 109) { new hirefee = HireCost(GetPlayerVehicleID(playerid)); if(GetPlayerVehicleID(playerid) >= 91 && GetPlayerVehicleID(playerid) <= 98) { if(SBizzInfo[0][sbProducts] == 0) { GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1); return 1; } if(PlayerInfo[playerid][pSFPbiskey] == 0) { GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3); TogglePlayerControllable(playerid, 1); return 1; } if (GetPlayerMoney(playerid) < SBizzInfo[0][sbEntranceCost]) { SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much cash !"); return 1; } GivePlayerMoney(playerid,-SBizzInfo[0][sbEntranceCost]); SBizzInfo[0][sbTill] += SBizzInfo[0][sbEntranceCost]; ExtortionSBiz(0, SBizzInfo[0][sbEntranceCost]); SBizzInfo[0][sbProducts]--; } if(GetPlayerVehicleID(playerid) >= 99 && GetPlayerVehicleID(playerid) <= 109) { if(SBizzInfo[1][sbProducts] == 0) { GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1); return 1; } if(PlayerInfo[playerid][pSFPbiskey] == 1) { GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3); TogglePlayerControllable(playerid, 1); return 1; } if (GetPlayerMoney(playerid) < SBizzInfo[1][sbEntranceCost]) { SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much cash !"); return 1; } GivePlayerMoney(playerid,-SBizzInfo[1][sbEntranceCost]); SBizzInfo[1][sbTill] += SBizzInfo[1][sbEntranceCost]; ExtortionSBiz(1, SBizzInfo[1][sbEntranceCost]); SBizzInfo[1][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), "~w~We hope you enjoy ~n~the use of this car~n~To lock or unlock your car~n~type ~g~/lock~n~~w~please drive safely",hirefee); TogglePlayerControllable(playerid, 1); GameTextForPlayer(playerid, string, 5000, 3); } } return 1; } The problem appeared when i started to edit the whole gamemode from Las Venturas to San Fierro. Please i really need some help, it's soon a new year and i promised the players that plays on it, that i'll solve the problem before 31.January! Tongue Thanks! Kind Regards, Sinces Smiley |