putplayerinvehicle problem
#1

I have a problem with this command:

Код:
	dcmd_stunt(playerid,params[])
{
	#pragma unused params
{
    PutPlayerInVehicle(playerid, stuntcar, 0);
   	SetPlayerPos(playerid,-2402.2542,734.2985,35.0156);
   	SetPlayerVirtualWorld(playerid,5);
   	}
	  new string[256];
  		new pName[30];
   	GetPlayerName(playerid, pName, 30);
   	format(string, 280, " %s in stunt", pName);
   	SendClientMessageToAll(ORRANGE, string);
   	}
    return 1;
when i type /stunt i dont get in the nrg-500, where is the problem?
Reply
#2

PutPlayerInVehicle must be at the end. When you use PutPlayerInVehicle and then SetPlayerPos, player will be removed from his vehicle. When the position in your SetPlayerPos is the same as the position of the vehicle, just remove it. Else use SetVehiclePos.
Reply
#3

Its possible to put player in vehicle with set player pos...

my code looks like that:
Код:
	dcmd_stunt(playerid,params[])
{
	#pragma unused params
 {
   	SetPlayerPos(playerid,-2402.2542,734.2985,35.0156);
   	SetPlayerVirtualWorld(playerid,5);
   	}
	  new string[256];
  		new pName[30];
   	GetPlayerName(playerid, pName, 30);
   	format(string, 280, "[/stunt] %s Prisijungл б stunt юaidimа", pName);
   	SendClientMessageToAll(ORRANGE, string);
    PutPlayerInVehicle(playerid, stuntcar, 0);
   	return 1;
   	}
But player is not puting in the nrg, what wrong?
Reply
#4

Do you have
Код:
new stuntcar = CreateVehicle(......);
?
Reply
#5

yes
Reply
#6

And do you have SetVehicleVirtualWorld(vehicleid, 5)?
Reply
#7

hm, now i done that, when i type /stunt i get in nrg but not in my seted player pos
I get to farm..
Reply
#8

Код:
dcmd_stunt(playerid,params[])
{
#pragma unused params
new string[64],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof pName);
format(string, sizeof string, "[/stunt] %s Prisijungл б stunt юaidimа", pName);
SendClientMessageToAll(ORRANGE, string);
new stuntcar = CreateVehicle(......); // Change it by yourself
PutPlayerInVehicle(playerid, stuntcar, 0);
SetPlayerPos(playerid,-2402.2542,734.2985,35.0156);
SetPlayerVirtualWorld(playerid,5);
return LinkVehicleToVirtualWorld(....); // Change it by yourself
}
Reply
#9

Quote:
Originally Posted by BlackFoX_UD_
Код:
dcmd_stunt(playerid,params[])
{
#pragma unused params
new string[64],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof pName);
format(string, sizeof string, "[/stunt] %s Prisijungл б stunt юaidimа", pName);
SendClientMessageToAll(ORRANGE, string);
new stuntcar = CreateVehicle(......); // Change it by yourself
PutPlayerInVehicle(playerid, stuntcar, 0);
SetPlayerPos(playerid,-2402.2542,734.2985,35.0156);
SetPlayerVirtualWorld(playerid,5);
return LinkVehicleToVirtualWorld(....); // Change it by yourself
}
still not working, btw linkvehicletovirtualworld? wtf? do u mean setvehicleto virtualworld? i tryed this stuff, but it's still not working
Reply
#10

Sorry Sa-mp dont Contains a Function like this i forget it xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)