Car spawner...[SOLVED!! XD THANX FOR ALL UR HELP! XD)
#1

SOLVED!! SOLVED!! TYHANX!!!!


THANXTHANXTHANXTHANXTHANXTHANXTHANXTHANXTHANXTHANX THANXTHANXTHANXTHANXTHANXTHANXTHANXTHANXTHANXTHANX THANXTHANXTHANXTHANXTHANXTHANXTHANXTHANXTHANXTHANX THANXTHANXTHANXTHANXTHANXTHANXTHANXTHANXTHANXTHANX THANXTHANXTHANXTHANX 1000000 times thanx!
Reply
#2

Line?
Reply
#3

Quote:
Originally Posted by Compton's Eazy E
Line?
i mean in one line in my script...

help please!! XD thanx :P
Reply
#4

He wants you to post the line of code you have the errors on so we can help you fix it without doing all the work for you.
Reply
#5

Quote:
Originally Posted by arie9000nerd
Hi!
i got a server.... a stunt server.... but my players always got a question if there is an option to spawn a car....
so, i tryed to make an script...to spawn a car if u typ: /nrg....
BUT I GOT 9 ERRORS IN ONE LINE!! I can't script......
can somebody help me making a simple script with a command: /nrg and then you get an nrg?
thanx! XD
oh, and btw, sory for my bad english....:P
pawn Код:
if (strcmp("/nrg", cmdtext, true, 10) == 0)
    {
        new Float:x,Float:y,Float:z,Float:a;
        GetPlayerPos(playerid,x,y,z);
        GetPlayerFacingAngle(playerid,a);
        AddStaticVehicle(522,x+2,y,z,a,1,1);
        SendClientMessage(playerid,0x21DD00FF,"You spawned a NRG-500");
        return 1;
    }
Reply
#6

first you need to create a function that spawns a car for you (this is the shortest way).

Add this in the end of your script:
pawn Код:
SpawnVehicle(playerid, vehicleid)
{
  new Float:X, Float:Y, Float:Z, Float:A; //Stores your position and Angle
  new Vehicle;
  GetPlayerPos(playerid, X, Y, Z); //Gets your Position
  GetPlayerFacingAngle(playerid, A); //Gets your Angle

  if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xF60000AA, "You have to be on foot to use this command!");

  Vehicle = CreateVehicle(vehicleid, X, Y, Z, A, 1, 169, -1); //Creates vehicle
  PutPlayerInVehicle(playerid, Vehicle, 0); //Puts you in the vehicle
  return 1;
}
second thing we need to do is to create an command:

Add this under OnPlayerCommandText:
pawn Код:
if(strcmp("/nrg", cmdtext, true, 10) == 0)
{
  SpawnVehicle(playerid, 522); //This creates an nrg and puts you in it.. ;D
  SendClientMessage(playerid, 0xF60000AA, "Your brand new nrg successfully spawned. :D");
  return 1;
}
you can create more cmds like this:

pawn Код:
if(strcmp("/infernus", cmdtext, true, 10) == 0)
{
  SpawnVehicle(playerid, 411); //You just need to change the 411 to vehicle you want to spawn. in this case you will spawn infernus.
  SendClientMessage(playerid, 0xF60000AA, "Your brand new infernus successfully spawned. :D");
  return 1;
}
Edited a bit

hope this helped.
-Augis, Tik LT server`is..
Reply
#7

Thanks for editing out the original problem. That sure will help people searching for solutions when they run into the same issue.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)