SA-MP Forums Archive
[HELP] Vehicle Spawing. [REPLY, PLEASE] - 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: [HELP] Vehicle Spawing. [REPLY, PLEASE] (/showthread.php?tid=79668)



[HELP] Vehicle Spawing. [REPLY, PLEASE] - Abernethy - 30.05.2009

Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
  new Menu:current;
  current = GetPlayerMenu(playerid);
  if(current == Vehicles)
  {
    switch(row)
    {
      case 0:{
      new Float:X,Float:Y,Float:Z;
		 	GetPlayerPos(playerid, X,Y,Z);
  		CreateVehicle(522,X,Y,Z,0,-1, -1);
  		SendClientMessage(playerid, COLOR_RED, "Vehicle Spawned");
      }
      case 1:{
      new Float:X,Float:Y,Float:Z;
			GetPlayerPos(playerid, X,Y,Z);
  		CreateVehicle(461,X,Y,Z,0,-1, -1);
  		SendClientMessage(playerid, COLOR_RED, "Vehicle Spawned");
      }
      case 2:{
      new Float:X,Float:Y,Float:Z;
      GetPlayerPos(playerid, X,Y,Z);
  		CreateVehicle(451,X,Y,Z,0,-1, -1);
  		SendClientMessage(playerid, COLOR_RED, "Vehicle Spawned");
      }
      case 3:{
      new Float:X,Float:Y,Float:Z;
      GetPlayerPos(playerid, X,Y,Z);
  		CreateVehicle(415,X,Y,Z,0,-1, -1);
  		SendClientMessage(playerid, COLOR_RED, "Vehicle Spawned");
      }
      case 4:{
      new Float:X,Float:Y,Float:Z;
      GetPlayerPos(playerid, X,Y,Z);
  		CreateVehicle(411,X,Y,Z,0,-1, -1);
  		SendClientMessage(playerid, COLOR_RED, "Vehicle Spawned");
      }
      case 5:{
      new Float:X,Float:Y,Float:Z;
      GetPlayerPos(playerid, X,Y,Z);
  		CreateVehicle(480,X,Y,Z,0,-1, -1);
  		SendClientMessage(playerid, COLOR_RED, "Vehicle Spawned");
      }
      case 6:{
      new Float:X,Float:Y,Float:Z;
      GetPlayerPos(playerid, X,Y,Z);
  		CreateVehicle(506,X,Y,Z,0,-1, -1);
  		SendClientMessage(playerid, COLOR_RED, "Vehicle Spawned");
      }
      case 7:{
      new Float:X,Float:Y,Float:Z;
			GetPlayerPos(playerid, X,Y,Z);
  		CreateVehicle(471,X,Y,Z,0,-1, -1);
  		SendClientMessage(playerid, COLOR_RED, "Vehicle Spawned");
      }
    }
  }
  return 1;
}
Код:
C:\Users\Madhouse\Desktop\Server\gamemodes\jumbo.pwn(905) : warning 202: number of arguments does not match definition
C:\Users\Madhouse\Desktop\Server\gamemodes\jumbo.pwn(911) : warning 202: number of arguments does not match definition
C:\Users\Madhouse\Desktop\Server\gamemodes\jumbo.pwn(917) : warning 202: number of arguments does not match definition
C:\Users\Madhouse\Desktop\Server\gamemodes\jumbo.pwn(923) : warning 202: number of arguments does not match definition
C:\Users\Madhouse\Desktop\Server\gamemodes\jumbo.pwn(929) : warning 202: number of arguments does not match definition
C:\Users\Madhouse\Desktop\Server\gamemodes\jumbo.pwn(935) : warning 202: number of arguments does not match definition
C:\Users\Madhouse\Desktop\Server\gamemodes\jumbo.pwn(941) : warning 202: number of arguments does not match definition
C:\Users\Madhouse\Desktop\Server\gamemodes\jumbo.pwn(947) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Warnings.
Creating the Vehicle is being the problem. Can anybody help?

Before you reply. NO. I do NOT, want to use somebody else's FS.


Re: [HELP] Vehicle Spawing. [REPLY, PLEASE] - Abernethy - 30.05.2009

BUMP - I really need to find out.


Re: [HELP] Vehicle Spawing. [REPLY, PLEASE] - Castle - 30.05.2009

You select the option and nothing happens?
I suggest to check other FS that has similar functions and see hows their CMD is made for the menu.


Re: [HELP] Vehicle Spawing. [REPLY, PLEASE] - Weirdosport - 30.05.2009

Do the SendClientMessage's trigger when you select a menu row?


Re: [HELP] Vehicle Spawing. [REPLY, PLEASE] - Felle - 30.05.2009

Try adding a respawn delay (not including that is what's giving you warnings) to the end of each CreateVehicle call. Bear in mind it's in seconds - just add 1 or something.


Re: [HELP] Vehicle Spawing. [REPLY, PLEASE] - Abernethy - 30.05.2009

http://pastebin.com/m27e84334

Bottom of the script on the Line for,
Код:
CreateVehicle
I get the error / warnings.


Re: [HELP] Vehicle Spawing. [REPLY, PLEASE] - Weirdosport - 30.05.2009

Quote:
Originally Posted by Felle
Try adding a respawn delay (not including that is what's giving you warnings) to the end of each CreateVehicle call. Bear in mind it's in seconds - just add 1 or something.
Felle is right, you've got your syntax wrong:

CreateVehicle(modelid, Float, Float:y,Float:z, Float:angle, color1, color2, respawn_delay)

EDIT: I bet the warnings told you exactly what was wrong, and if not a quick glance at the wiki would have done.


Re: [HELP] Vehicle Spawing. [REPLY, PLEASE] - Abernethy - 30.05.2009

Woah, it was right infront of me.

Thanks guys. It's fixed, I'll test it out.


Re: [HELP] Vehicle Spawing. [REPLY, PLEASE] - Felle - 30.05.2009

Quote:
Originally Posted by Abernethy
Woah, it was right infront of me.

Thanks guys. It's fixed, I'll test it out.
Sure, no problem. Next time, before rushing to post here, take some time to actually think through what could cause the warnings - especially like in this case when they tell you exactly what's wrong.


Re: [HELP] Vehicle Spawing. [REPLY, PLEASE] - Abernethy - 30.05.2009

Yeah sorry. I hadn't used CreateVehicle before.

Does anybody know how to make the player go up say, 3 Z Co-ordinates ?

Because the Vehicles are spawning on them, lol.