(3840) : error 029: invalid expression, assumed zero
#1

Код:
CMD:v(playerid, params[])
{
	new string[128], vID[32], vid, Float:x, Float:y, Float:z, Float:ang;
	if(sscanf(params, "s[32]", vID)) return SendClientMessage(playerid, COLOR_RED, "Syntax: /v (carname)");
	{
	if(isnumeric(vID)) vid = strval(vID);
	else vid = GetVehicleModelIDFromName(vID);
	if (vid < 400 || vid > 611) return SendClientMessage(playerid, COLOR_RED, "Vehicle ID Maxium (Left): 400 - Maxium (Right): 611");
	GetPlayerPos(playerid,x,y,z);
	GetPlayerFacingAngle(playerid,ang);
	if(PlayerVehicle[playerid] != INVALID_VEHICLE_ID) DestroyVehicle(PlayerVehicle[playerid]);
	PlayerVehicle[playerid] = CreateVehicle(vid, x, y, z, ang, -1, -1, 6000);
	LinkVehicleToInterior(PlayerVehicle[playerid], GetPlayerInterior(playerid));
	SetVehicleVirtualWorld(PlayerVehicle[playerid], GetPlayerVirtualWorld(playerid));
	PutPlayerInVehicle(playerid, PlayerVehicle[playerid], 0);
	}
line 3840 = else
	{
		new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
 	    if(PlayerVehicle[playerid] != INVALID_VEHICLE_ID) DestroyVehicle(PlayerVehicle[playerid]);
	   	ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");

	}
	return 1;
}
Reply
#2

Try this:

Код:
CMD:v(playerid, params[])
{
	new string[128], vID[32], vid, Float:x, Float:y, Float:z, Float:ang;
	if (!strlen(vID)) return SendClientMessage(playerid, COLOR_RED, "Syntax: /v (carname)");
	if(sscanf(params, "s[32]", vID))
	{
		if(isnumeric(vID)) vid = strval(vID);
		else vid = GetVehicleModelIDFromName(vID);
		if (vid < 400 || vid > 611) return SendClientMessage(playerid, COLOR_RED, "Vehicle ID Maxium (Left): 400 - Maxium (Right): 611");
		GetPlayerPos(playerid,x,y,z);
		GetPlayerFacingAngle(playerid,ang);
		if(PlayerVehicle[playerid] != INVALID_VEHICLE_ID) DestroyVehicle(PlayerVehicle[playerid]);
		PlayerVehicle[playerid] = CreateVehicle(vid, x, y, z, ang, -1, -1, 6000);
		LinkVehicleToInterior(PlayerVehicle[playerid], GetPlayerInterior(playerid));
		SetVehicleVirtualWorld(PlayerVehicle[playerid], GetPlayerVirtualWorld(playerid));
		PutPlayerInVehicle(playerid, PlayerVehicle[playerid], 0);
	}
	else
	{
		new allvehicles[] = "1\tAirplanes\n2\tHelicopters\n3\tBikes\n4\tConvertibles\n5\tIndustrial\n6\tLowriders\n7\tOffRoad\n8\tPublic Service Vehicles\n9\tSaloons\n10\tSport Vehicles\n11\tStation Wagons\n12\tBoats\n13\tUnique Vehicles\n14\tRC Vehicles\n15\tTrailers";
 	    if(PlayerVehicle[playerid] != INVALID_VEHICLE_ID) DestroyVehicle(PlayerVehicle[playerid]);
	   	ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST," Vehicles: || Scroll Down for more",allvehicles,"Select","Cancel");
	}
	return 1;
}
Reply
#3

thx you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)