Job car - 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: Job car (
/showthread.php?tid=594885)
Job car -
Karolukas123 - 24.11.2015
hey, so i don't find a bug.. why i dont get message..nothing happen, player aren't removefrom car and else...
Код:
if(newstate == PLAYER_STATE_DRIVER)
{
if(vehicleid >= TaxiCar[0] && vehicleid <= TaxiCar[9])
{
if(specialybe[playerid] != 5 && playerData[playerid][admin] < 4)
{
SendClientMessage(playerid, -1, "you cant use car..");
Stop(playerid);
}
format(msg, sizeof(msg), "you can drive car, because you workin");
SendClientMessage(playerid, -1,msg);
print("Check");
Re: Job car -
ATGOggy - 25.11.2015
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
{
for(new i=0; i<10;i++)
{
if(vehicleid == TaxiCar[i])
{
if(specialybe[playerid] != 5 && playerData[playerid][admin] < 4)
{
SendClientMessage(playerid, -1, "you cant use car..");
Stop(playerid);
}
format(msg, sizeof(msg), "you can drive car, because you workin");
SendClientMessage(playerid, -1,msg);
print("Check");
Re: Job car -
Sew_Sumi - 25.11.2015
Quote:
Originally Posted by ATGOggy
pawn Код:
if(newstate == PLAYER_STATE_DRIVER) { for(new i=0; i<10;i++) { if(vehicleid == TaxiCar[i]) { if(specialybe[playerid] != 5 && playerData[playerid][admin] < 4) { SendClientMessage(playerid, -1, "you cant use car.."); Stop(playerid); } format(msg, sizeof(msg), "you can drive car, because you workin"); SendClientMessage(playerid, -1,msg); print("Check");
|
Stop pasting up "solutions" without stating what they are.
I'm also sure that your for loop, will cause a problem being that the array of cars, is smaller than the for loop.
Re: Job car -
CmZxC - 25.11.2015
Try replacing
with
Also your code is saying that if you're level 4 or higher admin, you will also be able to use the car.
Did you run your test while not being an admin?
Re: Job car -
Karolukas123 - 25.11.2015
Ye, its work, i was create just car.. but use if(vehicleid >= TaxiCar[0] && vehicleid <= TaxiCar[9])
so i just need add TaxiCar[0] = CreateVehicleEx