SA-MP Forums Archive
My car spawning problem.? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: My car spawning problem.? (/showthread.php?tid=262618)



My car spawning problem.? - lawonama - 18.06.2011

I'm using this script:
PHP код:
            new veh;
            
veh CreateVehicle(4152135.12, -2552.6513.559000100000000000000000000000000);
            
PutPlayerInVehicle(playerid,veh,0);
            
SetCameraBehindPlayer(playerid); 
I want to: If he is already in a car, he cant spawn a car and it will say:

SendClientMessage(playerid, 0xFFFFFFFF, "You are already in a car, leave your car to spawn a new one.");


Re: My car spawning problem.? - boelie - 18.06.2011

pawn Код:
if(IsplayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, 0xFFFFFFFF, "You are already in a car, leave your car to spawn a new one.");
}
else
//your stuff



Re: My car spawning problem.? - lawonama - 18.06.2011

Thanx!

I have this now:

PHP код:
            new veh4;
            if(
IsPlayerInAnyVehicle(playerid))
            {
            
SendClientMessage(playerid0xFFFFFFFF"You are already in a vehicle, leave your car to spawn a new one.");
            }
            else
            
veh4 CreateVehicle(4112135.12, -2552.6513.559000100000000000000000000000000);
            
PutPlayerInVehicle(playerid,veh4,0);
            
SetCameraBehindPlayer(playerid);
            
SendClientMessage(playerid0xFFFFFFFF"You bought a brand new Infernus!!");
            
GivePlayerMoney(playerid,-2500); 
But i want, when he doesn't have enough money then there will come a message like:
SendClientMessage(playerid, 0xFFFFFFFF, "You don't have enough money for this vehicle!");


Re: My car spawning problem.? - boelie - 18.06.2011

then it could look like this
pawn Код:
if(GetPlayerMoney(playerid, < 50000))
together with the rest ofcourse