/flip cmd
#1

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);
                    }
                }
            }
Reply
#2

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)
Reply
#3

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
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)