SA-MP Forums Archive
/flip cmd - 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: /flip cmd (/showthread.php?tid=431759)



/flip cmd - Geeboi_Mehdi - 19.04.2013

i really need one here is cmds i use
pawn Код:
if(strcmp("/respawnmycars", cmdtext, true) == 0)
    {
        new query[250];
        format(query,sizeof(query),"SELECT NULL FROM `pvehicles` WHERE OwnedBy = '%s'", PlayerName(playerid));
        mysql_reconnect();
        mysql_query(query);
        mysql_store_result();
        new rows = mysql_num_rows();
        mysql_free_result();
        new finished = 0;
        if(rows > 0)
        {
            for(new i=0;i <sizeof(PVInfo);i++)
            {
                if(!IsVehicleOccupied(PVInfo[i][vpVehicleSpawned]))
                {
                    if(!strcmp(PVInfo[i][vpOwnedBy], PlayerName(playerid)))
                    {
                        finished = 1;
                        SetVehicleToRespawn(PVInfo[i][vpVehicleSpawned]);
                        //ReloadVehicle(i);
                    }
                }
            }



Re: /flip cmd - 2K9CON - 19.04.2013

PHP код:
    if(strcmp(cmdtext"/flip"true) == 0)
    {
        new 
currentveh;
        new 
Float:angle;
        
currentveh GetPlayerVehicleID(playerid);
        
GetVehicleZAngle(currentvehangle);
        
SetVehicleZAngle(currentvehangle);
        
SendClientMessage(playeridCOLOR_GREEN"Your vehicle has been flipped.");
        return 
1;
    } 
That should work (Not tested)


Re: /flip cmd - Geeboi_Mehdi - 19.04.2013

Thanks so much but can you make it a bit pro?
like you have to be a driver of the vehicle and must be in a vehicle not a plane or so thanks man


Re: /flip cmd - iAidan - 19.04.2013

A little bit more 'pro'
pawn Код:
if(strcmp(cmdtext, "/flip", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
             new currentveh;
            currentveh = GetPlayerVehicleID(playerid);
            if(GetVehicleModel(currentveh) == 519 || GetVehicleModel(currentveh) == 520) // Carry these on with the vehicle id's etc..
            {
                SendClientMessage(playerid, -1, "You cannot do this in an airplane");
            }
                new Float:angle;
                GetVehicleZAngle(currentveh, angle);
                SetVehicleZAngle(currentveh, angle);
                SendClientMessage(playerid, COLOR_GREEN, "Your vehicle has been flipped.");
            }
            return 1;
    }
Untested.