Need help with little thing. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help with little thing. (
/showthread.php?tid=303437)
Need help with little thing. -
antsolen - 13.12.2011
Hello i have
Код:
if(strcmp(cmd, "/rentcar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(GetPlayerVehicleID(playerid) >= 104 && GetPlayerVehicleID(playerid) <= 115)
{
new hirefee = HireCost(GetPlayerVehicleID(playerid));
if(SBizzInfo[0][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
return 1;
}
if (GetPlayerMoney(playerid) < 500)
{
SendClientMessage(playerid, COLOR_GRAD2, " Sul pole piisavalt raha !");
return 1;
}
if(HireCar[playerid] != 299)
{
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
SendClientMessage(playerid, COLOR_GREY, "Sea pead ennem praegu rendil oleva auto rendi lхpetama !");
return 1;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(HireCar[i] == GetPlayerVehicleID(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Keegi juba rendib seda !");
return 1;
}
}
/*if(PlayerInfo[playerid][pPbiskey] == 1)
{
GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3);
TogglePlayerControllable(playerid, 1);
return 1;
}*/
SafeGivePlayerMoney(playerid,-500);
SBizzInfo[0][sbTill] += 500;
ExtortionSBiz(0, SBizzInfo[0][sbEntranceCost]);
SBizzInfo[0][sbProducts]--;
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate();
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~2ra unusta hiljem ~r~/l8petaautorent~n~~g~/lukusta ~w~et auto uksed lukku panna.",hirefee);
SendClientMessage(playerid, COLOR_YELLOW2, "Sa vхid nyyd mootori t88le panna !");
gEngine[playerid] = 0;
engineOn[GetPlayerVehicleID(playerid)] = false;
//TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, string, 5000, 3);
}
}
return 1;
}8
Now i have question how i make car 104-115 engine will all the time on ?
Its rent command from larp
Re: Need help with little thing. -
Ballu Miaa - 13.12.2011
I wish i could understand what have you typed in your SendClientMessage Functions for better understanding.
I got half of the things' not fully! Let me see your engineOn[GetPlayerVehicleID(playerid)] Function for more understanding of the code!. So that i can tell you a way to dot his according to your code!
Re: Need help with little thing. -
Azzeto - 13.12.2011
Somthing like
PHP код:
if(variable == 104 || variable == 105 || variable == 106 || variable == 107 || variable == 108 || variable == 109 || variable == 110 || variable == 111 || variable == 112 || variable == 113 || variable == 114 || variable == 115)
I think thats how you would do it.
You would have to use like variable = GetPlayerVehicleID(playerid);