[HELP] Vehicle Spawing. [REPLY, PLEASE]
#1

Код:
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.
Reply
#2

BUMP - I really need to find out.
Reply
#3

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.
Reply
#4

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

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.
Reply
#6

http://pastebin.com/m27e84334

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

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.
Reply
#8

Woah, it was right infront of me.

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

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.
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)