17.09.2018, 15:19
(
Последний раз редактировалось DarknesS1988; 19.09.2018 в 02:54.
)
I have definied:
Is it somehow possible change this
with this:
In This command
OnVehicleSpawn
Enum from my script maybe can be used:
PHP код:
#define VEHICLE_TYPE_LAW_ENFOREMENT 1
#define VEHICLE_TYPE_CIVILIAN 2
#define VEHICLE_TYPE_DRIVER 3
#define VEHICLE_TYPE_ADMIN 4
PHP код:
CreateVehicle(modelid, X,Y,Z + 2.0,A + 90.0,0,0, 604800);
PHP код:
CreateStaticVehicle(ctype,modelid,Float:X,Float:Y,Float:Z,Float:A,ColorOne,ColorTwo);//(or 1,2,3,4)
PHP код:
dcmd_v(playerid, params[])
{
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdminLevel] > 0)
{
new idx,modelid;
new tmp[256],string[256];
tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /v (Modelid/Name)");
return 1;
}
if(isNumeric(tmp))
{
modelid = strval(tmp);
}else{
modelid = GetVehicleModelIDFromName( tmp );
if( modelid == -1 )
{
SendClientMessage(playerid, COLOR_ERROR, "[ERROR] Invalid MODELID/NAME");
return 1;
}
}
if(modelid < 400 || modelid > 611)
{
SendClientMessage(playerid, COLOR_ERROR, "Enter A Vehicle Modelid Between 400 And 611");
return 1;
}
new Float:X, Float:Y, Float:Z, Float:A;//,Interior,World;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
//Interior = GetPlayerInterior(playerid);
//World = GetPlayerVirtualWorld(playerid);
GetXYInFrontOfPlayer(playerid, X, Y, 5.0);
CreateVehicle(modelid, X,Y,Z + 2.0,A + 90.0,0,0, 604800);
format(string, sizeof(string), "%s Spawned A (%s), Modelid: (%d)", PlayerInfo[playerid][pName], aVehicleNames[modelid - 400], modelid);
}else{
SendClientMessage(playerid, COLOR_ERROR, "Unknown Command! Type /cmds For Available Commands.");
}
return 1;
}
PHP код:
public OnVehicleSpawn(vehicleid)
{
new string[256];
if (CarInfo[vehicleid][cOwned] > 0)
{
new playerid = CarInfo[vehicleid][cOwned];
PlayerInfo[playerid][pCar] = 0;
}
format(string, sizeof(string), "Not Owned");
strmid(CarInfo[vehicleid][cOwner], string, 0, strlen(string), 256);
CarInfo[vehicleid][cOwned] = -1;
CarInfo[vehicleid][cLock] = 0;
CarInfo[vehicleid][cSold] = 0;
CarInfo[vehicleid][cValue] = 0;
SetVehicleHealth(vehicleid,999);
return 1;
}
PHP код:
enum cInfo
{
cType,
cModel,
Float:cLocationX,
Float:cLocationY,
Float:cLocationZ,
Float:cLocationA,
cLocationI,
cLocationW,
cColorOne,
cColorTwo,
cOwner[MAX_PLAYER_NAME],
cOwned,
cLock,
cValue,
cSellable,
cSold,
cSpawnTime
};