PDA

View Full Version : /v always shows ERROR: Invalid vehicle ID when ID isn't invalid


Wizardking
22/01/2015, 12:28 PM
CMD:v(playerid, params[])
{
new
modelid,
Float:zPos[ 3 ];

if( sscanf( params, "i", modelid ) ) SendClientMessage(playerid, COLOR_GREY, "USAGE: /v [vehicle id]");
if(modelid < 400 || modelid > 611) return SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid vehicle ID.");
{
GetPlayerPos( playerid, zPos[ 0 ], zPos[ 1 ], zPos[ 2 ] );
CreateVehicle( modelid, zPos[0], zPos[ 1 ], zPos[ 2 ], 0, 155, 1, -1);
}
return 1;
}

Help please? this has got me stumped i'm using YCMD for this everytime I use /v it will say it has an invalid vehicle ID even if it is correct

Anuris
22/01/2015, 12:35 PM
CMD:v(playerid, params[])
{
new
modelid,
Float:zPos[ 3 ];

if( sscanf( params, "i", modelid ) ) SendClientMessage(playerid, COLOR_GREY, "USAGE: /v [vehicle id]");
if(modelid < 400 || modelid > 611) return SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid vehicle ID.");
else
{
GetPlayerPos( playerid, zPos[ 0 ], zPos[ 1 ], zPos[ 2 ] );
CreateVehicle( modelid, zPos[0], zPos[ 1 ], zPos[ 2 ], 0, 155, 1, -1);
}
return 1;
}

Wizardking
22/01/2015, 12:43 PM
CMD:v(playerid, params[])
{
new
modelid,
Float:zPos[ 3 ];

if( sscanf( params, "i", modelid ) ) SendClientMessage(playerid, COLOR_GREY, "USAGE: /v [vehicle id]");
if(modelid < 400 || modelid > 611) return SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid vehicle ID.");
else
{
GetPlayerPos( playerid, zPos[ 0 ], zPos[ 1 ], zPos[ 2 ] );
CreateVehicle( modelid, zPos[0], zPos[ 1 ], zPos[ 2 ], 0, 155, 1, -1);
}
return 1;
}


it works but if i just do /v to show the USAGE message it still comes up with the INVALID VEHICLE ID message aswell, anyway to stop this?

AdamsP
22/01/2015, 12:45 PM
This is zcmd not ycmd

Schneider
22/01/2015, 12:46 PM
Works fine with zcmd...

BroZeus
22/01/2015, 02:07 PM
You forgot a return statement before sending usage
Use this

CMD:v(playerid, params[])
{
new
modelid,
Float:zPos[ 3 ];
if( sscanf( params, "i", modelid ) )return SendClientMessage(playerid, COLOR_GREY, "USAGE: /v [vehicle id]");
if(modelid < 400 || modelid > 611) return SendClientMessage(playerid, COLOR_GREY, "ERROR: Invalid vehicle ID.");
GetPlayerPos( playerid, zPos[ 0 ], zPos[ 1 ], zPos[ 2 ] );
CreateVehicle( modelid, zPos[0], zPos[ 1 ], zPos[ 2 ], 0, 155, 1, -1);
return 1;
}