/veh Help
#1

This is using the latest SSCANF and ZCMD

Код:
command(veh, playerid, params[])
{
	new model, color1, color2, vehicleid, Float:x, Float:y, Float:z, Float:a;
	if(PlayerInfo[playerid][AdminLevel] < 1)
	{
		SendClientMessage(playerid, COLOR_RED, "   Error: You are not authorized");
	}
	else if(sscanf(params, "iii", model, color1, color2))
	{
	    SendClientMessage(playerid, COLOR_PINK, "   Usage: /veh [modelid] [color1] [color2]");
	}
	else if(model < 400 || model > 611)
	{
	    SendClientMessage(playerid, COLOR_ORANGE, "   Invalid Model");
	}
	else if(color1 < 0 || color1 > 256)
	{
	    SendClientMessage(playerid, COLOR_ORANGE, "   Invalid Color 1");
	}
	else if(color2 < 0 || color2 > 256)
	{
	    SendClientMessage(playerid, COLOR_ORANGE, "   Invalid Color 2");
	}
	else
	{
	    GetPlayerPos(playerid, x, y, z);
	    GetPlayerFacingAngle(playerid, a);
	    vehicleid = CreateVehicle(541, x, y, z, a, color1, color2, -1);
	    CreatedVehicle[vehicleid] = 1;
	    SendClientMessage(playerid, COLOR_WHITE, "   Vehicle Created");
	}
	return 1;
}
I do this command everything works fine. It say "Vehicle Create," but it doesn't created the vehicle. This is probably an obvious error but I just don't seem to find it.
Reply
#2

You mean that the vehicle doesn't appear? Have you checked the Virtual worlds and all?
Reply
#3

Thanks, I forgot that I change the person virtual world for the log in view.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)