PHP код:
CMD:vcar(playerid, params[])
{
new Float:x,Float:y,Float:z,Float:a, vehicleid ;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
if(PlayerInfo[playerid][pVip] >= CmdsOptions[vcar] || IsPlayerAdmin(playerid))
{
new string[128],
currenttime = gettime();
format(string,sizeof(string),"You must wait %i seconds to use this command",((vcarCooldown[playerid] + 240) - currenttime));
if(currenttime < (vcarCooldown[playerid] + 240))
return SendClientMessage(playerid,COLOR_RED,string);
if(IsPlayerInAnyVehicle(playerid))
vehicleid = GetPlayerVehicleID(playerid);
DestroyVehicle(vehicleid);
GetPlayerVehicleID(playerid);
PutPlayerInVehicle(playerid, vehicleid = CreateVehicle(587, x, y, z, a, 0, 1, 100), 0);
SetVehicleHealth(vehicleid, 3000);
GetPlayerVehicleID(playerid);
new str[128];
format(str, sizeof(str),"You spawned %s.",VehicleNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
SendClientMessage(playerid,COLOR_BLUE,str);
vcarCooldown[playerid] = gettime();
return 1;
}
else return SendClientMessage(playerid,COLOR_RED,"You do not have permission to use this command!");
}