Problem[JUST LOOK PLEASE]
#1

ok first thing, you might not understand the way that i will try to explain this.. i will try my best to make it understandable,
Ok i am making a GM and when you spawn it create a random vehicle i have the random thing down only problem is that it's supposed to put the player in the vehicle that it spawned im not sure how to do this but ive tryed PutPlayerInVehicle with no luck what function, and how should i use it to put the player in the vehicle when he spawns...
If you have any problems understanding something in here quote what you didnt understand and i will make it more understandable.......
Someone Has To Know This! Please Help Me Out
Thanks, Cody Beer
Reply
#2

ok that is solved new question how do i make it so when they leave their vehicle or die after 20 seconds after they die / exit their vehicle it does the same thing as when you spawn (puts you in a vehicle and spawns you at a certain place) here is the OnPlayerSpawn code
Код:
public OnPlayerSpawn(playerid)
{
	SetPlayerPos(playerid, 4117.751953125,-1185.1917724609,22);
	SetPlayerFacingAngle(playerid, 270.27026367188);
	new iRandom = random(sizeof(SumoRandCars));
	new iRandColors = random(sizeof(SumoRandColors));
	new VehID[256];
	VehID[playerid] = CreateVehicle(SumoRandCars[iRandom][0], 4117.751953125,-1185.1917724609,22,270.27026367188,SumoRandColors[iRandColors][0],SumoRandColors[iRandColors][0], 50000000);
	PutPlayerInVehicle(playerid, VehID[playerid], 0);
	return 1;
}
Thanks, Cody Beer
Reply
#3

Anyone? this isnt important but i need it as soon as possible....
Reply
#4

You'll have to use a timer to get this done...

To kill 2 birds with 1 stone, check to see if player is on foot rather than exiting a vehicle or dying UNLESS at some point in your gamemode players are allowed to be onfoot etc. OnPlayerStateChange (Or very similar) is the key to determine whether a player goes onfoot by exiting/dying.

So if the player is on foot, execute whatever code to put them back in a vehicle after 20 seconds or whatever. But use the timer to determine when 20 seconds have passed...
Reply
#5

tryed something similar it worked but it didnt (there were 2 sides to it)
Reply
#6

Then you should post what went wrong there because without a timer, you don't have a chance at making this work at all...

Or if not a timer problem, should still post this information about went did go wrong if you want help etc.
Reply
#7

well i fixed some things when i used a time and my own public functions it just spawned 3 cars and put you in one may be solved but may not be so (im not sure)
Reply
#8

Sounds like a loop problem to me, so after you spawn & put the player in the vehicle, try inserting a 'break;' or if it's the timer itself, kill the timer...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)