Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Why is this returning a bad command?

$
0
0
The command WORKS but if you're not an admin or in a vehicle as it says, it returns the unsuccessful command performed message.

PHP Code:

CMD:parkcar(playeridparams[])
{
    new
        
string[128], Float:Pos[4], currentcar GetPlayerVehicleID(playerid), vehid IsFactionVehicle(currentcar), file FactionCarFileID(vehid);

    if(
PlayerData[playerid][AdminLevel] < 4)
       
SendClientMessage(playeridGREY"You are not authorized to use this command.");

    if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
          
SendClientMessage(playeridADM"ERROR:{FFFFFF} You're not in a vehicle to park.");

    
GetPlayerPos(playeridPos[0], Pos[1], Pos[2]);
    
GetVehicleZAngle(currentcarPos[3]);

    
format(stringsizeof(string), "FactionVehicles/Vehicle_%d.ini"file);

    if(
fexist(string))
    {
        
dini_FloatSet(string"vehiclePosX"Pos[0]);
        
dini_FloatSet(string"vehiclePosY"Pos[1]);
        
dini_FloatSet(string"vehiclePosZ"Pos[2]);
        
dini_FloatSet(string"vehiclePosR"Pos[3]);

        
SetVehicleToRespawn(FacVehicleData[file][vehicleIG]);
        
PutPlayerInVehicle(playeridFacVehicleData[file][vehicleIG], 0);

        
printf("DEBUG: Faction vehicle ID %d (file ID %d) park pos was changed by %s."FacVehicleData[file][vehicleIG], fileGetName(playerid));

        
SendClientMessage(playeridADM"SERVER:{FFFFFF} This vehicles' park position was changed.");
    }

    return 
1;



Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>