31.10.2013, 22:23
Hello, as I mentioned previously, my COMMAND /veh
first time I type
/veh 522 1 1 ( white NRG-500, or anything else)
it CREATES a vehicle, put me in vehicle, but returns 0 (COMMAND DOES NOT EXIST)
when i /Dtc (destroy this vehicle)
and than again type:
/veh 522 1 1 ( any model/color )
it CREATES a vehicle, put me in vehicle, Does NOT return 0, but it won't show me up string (in client message, formated previously ([A] > %s has crated vehicle blabla)
Dafuq, I have no idea what's wrong in this code, if anybody knows please Help me, I will rep(rape) you
P.S. Function SendAdminMessage works fine, that's not the problem
first time I type
/veh 522 1 1 ( white NRG-500, or anything else)
it CREATES a vehicle, put me in vehicle, but returns 0 (COMMAND DOES NOT EXIST)
when i /Dtc (destroy this vehicle)
and than again type:
/veh 522 1 1 ( any model/color )
it CREATES a vehicle, put me in vehicle, Does NOT return 0, but it won't show me up string (in client message, formated previously ([A] > %s has crated vehicle blabla)
Dafuq, I have no idea what's wrong in this code, if anybody knows please Help me, I will rep(rape) you
P.S. Function SendAdminMessage works fine, that's not the problem
pawn Код:
YCMD:veh(playerid, params[], help)
{
#pragma unused help
new vehicle,col1,col2,string[128],Float:x,Float:y,Float:z,Float:a,crVeh;
if(PlayerInfo[playerid][pAdmin] < 2)
return SCM(playerid,COLOR_DARKRED,"[CA:RP]"gray" Admins only!");
else if(sscanf(params, "iii", vehicle, col1,col2))
return SCM(playerid, COLOR_GRAY,"Usage: /veh [model] [Color 1] [Color 2]");
else if(vehicle< 400 || vehicle> 611)
return SCM(playerid, COLOR_GRAY,"Wrong vehicle model (400-611)");
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid, a);
crVeh = CreateVehicle(vehicle,x,y,z,a,col1,col2,-1);
PutPlayerInVehicle(playerid, crVeh, 0);
vehicleCreated[crVeh] = 1;
SetVehicleNumberPlate(crVeh,"Admin Car");
format(string, sizeof(string), " You have created vehicle | Model : %d | ID: %d | Model Name: %s", vehicle, crVeh, GetVehicleName(vehicle));
SCM(playerid, COLOR_GRAY,string);
format(string, sizeof(string), " [>>] [A] %s has created vehicle | ID = %d | Model = %d (%s)", PlayerName(playerid), crVeh, vehicle, GetVehicleName(vehicle));
SendAdminMessage(1, COLOR_YELLOW, string);
return 1;
}