SA-MP Forums Archive
spawn veh - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: spawn veh (/showthread.php?tid=596887)



spawn veh - GeneralAref - 23.12.2015

i have this.how to make if player Player has already spawning car,Removed
PHP код:
CMD:vcar(playeridparams[])
{
    new 
Float:x,Float:y,Float:z,Float:avehicleid ;
    
GetPlayerPos(playeridxyz);
    
GetPlayerFacingAngle(playerida);
    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(playeridvehicleid CreateVehicle(587xyza01100), 0);
        
SetVehicleHealth(vehicleid3000);
        
GetPlayerVehicleID(playerid);
        new 
str[128];
        
format(strsizeof(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!");