[HELP] Making Tuned Spawned Vehicles for 1 person
#1

Ok, so i want to make a vehicle but a tuned one i imagine that i start by doing

new gTunedFlash;

gTunedFlash = CreateVehicle(blahblahlbalh);

gTunedFlash {

MODLE IDS

}

if i went wrong then tell me!

i also want to set the numberplate but will it work because i know you have to respawn the vehicle?

but after that i would like to make the car just for 1 person so there name could someone tell me the way of doing it? and if the person that enters the car doesn't have that name eg. [Sw]Shadows car? they get slaped or somthing?

Please HELP!!!!

Shadow
Reply
#2

anyone there?
Reply
#3

Sorry for now Triple post! But is anyone out there that can help me plz?
Reply
#4

hey, not so sure about the liscene plate b4, never looked into it b4,
but with the slap part you could do a simple function something like

Code:
new PlayerName[MAX_PLAYER_NAME], string[128], str[128], file[256];
	GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);

if(playername == blahblah && player is in car gflash or w.e you call it <<-- this statment would probably be pretty complex, it just looks simple cuz im not putting it out fully){
set player in car = false
or just copy a /slap function from a admin script. heres the one mine uses

new Float:Health, Float:x, Float:y, Float:z; GetPlayerHealth(player1,Health); SetPlayerHealth(player1,Health-25);
				GetPlayerPos(player1,x,y,z); SetPlayerPos(player1,x,y,z+5); PlayerPlaySound(playerid,1190,0.0,0.0,0.0); PlayerPlaySound(player1,1190,0.0,0.0,0.0);
sorry that the syntax for playername wasnt right, im tired atm and dont have energy to make a new code in pawno xD

but hope that points you in the right direction



Reply
#5

pawn Code:
// Top of script
forward ElevatePlayer(playerid, amount);

// Anywhere in script
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  if(newstate == PLAYER_STATE_DRIVER)
  {
    new PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    if(strcmp(PlayerName, "[Sw]Shadow", true) == 1 && GetPlayerVehicleID(playerid) == gTunedFlash)
    {
      SendClientMessage(playerid, color, "You are not allowed to drive this"); // Replace color with a color of your choice
     RemovePlayerFromVehicle(playerid);
      SetTimerEx("ElevatePlayer", 1000, 0, "dd", playerid, 5); // If you want to slap them higher then change 5 to another value
    }
    return 1;
  }
  return 1;
}

// Anywhere in script
public ElevatePlayer(playerid, amount)
{
  new Float:x, Float:y, Float:z;
  GetPlayerPos(playerid, x, y, z);
  SetPlayerPos(playerid, x, y, z + amount);
  return 1;
}
Reply
#6

Cheers

EDIT::: Would this work perfectly is that the hole thing? or do i need to edit anything you have put?
Reply
#7

Read the comments...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)