CreateVehicle
#1

Hi everyone,

I am trying to test out this new system native CreateVehicle(vehicletype, Float, Float:y, Float:z, Float:rotation, color1, color2, respawndelay, addsiren=0); and says that audio of the sirens plays on it, but the problem is when I try it in game nothing happens, here is the code and it comes with a warning as well (note that I have updated the includes etc)

pawn Код:
CMD:sveh(playerid, params[])
{
    new id, Float:pos[4], col[2];
    if(sscanf(params, "iii", id, col[0], col[1])) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /veh [vehicleid/destroy] [color1] [color2]");
    if(id < 400 || id > 611) return SendClientMessage(playerid, COLOR_GREY, "Vehicles are between 400 and 611.");
    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    GetPlayerFacingAngle(playerid, pos[3]);
    CreateVehicle(id, pos[0], pos[1], pos[2], pos[3], col[0], col[1], 12000, 0);
    return 1;
}
The warning is this:
warning 202: number of arguments does not match definition < This code only goes for the CreateVehicle, as when I take the siren part off it works :/
Reply
#2

Hello!

Are you updated your server includes?

By the way, write your code so, CreateVehicle need a 1 for the sirene.

PHP код:
CMD:sveh(playeridparams[])
{
    new 
idFloat:pos[4], col[2];
    if(
sscanf(params"iii"idcol[0], col[1])) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /veh [vehicleid/destroy] [color1] [color2]");
    if(
id 400 || id 611) return SendClientMessage(playeridCOLOR_GREY"Vehicles are between 400 and 611.");
    
GetPlayerPos(playeridpos[0], pos[1], pos[2]);
    
GetPlayerFacingAngle(playeridpos[3]);
    
CreateVehicle(idpos[0], pos[1], pos[2], pos[3], col[0], col[1], 120001);
    return 
1;

Reply
#3

I have the same problem, i've updated all my includes.

Код:
gamemodes\wip.pwn(6176) : warning 202: number of arguments does not match definition
Line 6176
pawn Код:
CreateVehicle(modelid,x+2,y,z+2,a,color1,color2,-1,1);
Reply
#4

Which ones though? I have done the pawno includes and I still get that same warning for the code
Reply
#5

A row of my script:
PHP код:
return CreateVehicle(560,Pos[0],Pos[1],Pos[2],0.0,19,19,-1,0); 
and it works clearly
Reply
#6

Quote:
Originally Posted by McGuiness
Посмотреть сообщение
Which ones though? I have done the pawno includes and I still get that same warning for the code
It's in your a_vehicle.inc
Reply
#7

Quote:
Originally Posted by Mencent
Посмотреть сообщение
A row of my script:
PHP код:
return CreateVehicle(560,Pos[0],Pos[1],Pos[2],0.0,19,19,-1,0); 
and it works clearly
Even with that am still getting the same warning
Reply
#8

Quote:
Originally Posted by ihatetn931
Посмотреть сообщение
It's in your a_vehicle.inc
I know that, its just there is that include folder as well where the include folder is located in the same place as the SA-MP's exe
Reply
#9

Update your whole file, not only the includes.
Reply
#10

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Update your whole file, not only the includes.
Still giving me that warning its doing my heading in now
Reply


Forum Jump:


Users browsing this thread: