#1

Can someone help me about a problem in my server
when someone G in a vehicle with a deagle it is rapid fire right? so how i can makea player enter a vehicle and it will remove the deagle. I search this is but i cant find it
Reply
#2

PHP код:
//Top of your script
new DriveBy_Weps[] ={
25,28,29,30,31,32}; // The ONLY weapons which is allowed to use as passenger

public OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == PLAYER_STATE_PASSENGER)
    {
        new
            
bool:DBWep false;
        for(new 
0isizeof(DriveBy_Weps); i++)
        {
            if(
GetPlayerWeapon(playerid) == DriveBy_Weps[i])
            {
                
SetPlayerArmedWeapon(playeridDriveBy_Weps[i]);
                
DBWep true;
                break;
            }
        }
        if(
DBWep) return 1;
        else if(!
DBWep)
        {
            new
                
bool:DBWep2 false,
                
p_WepData[13][2];
            for(new 
0i13i++)
            {
                
GetPlayerWeaponData(playeridip_WepData[i][0], p_WepData[i][1]);
                for(new 
aasizeof(DriveBy_Weps); a++) 
                {
                    if(
p_WepData[i][0] == DriveBy_Weps[a] && p_WepData[i][0] >= 1)
                    {
                        
SetPlayerArmedWeapon(playeridDriveBy_Weps[a]);
                        
DBWep2 true;
                        break;
                    }
                }
                if
                (
DBWep2) break;
            }
        }
        if(!
DBWep2) return SetPlayerArmedWeapon(playerid0), 1;
    }
    return 
1;

Reply
#3

Dont complicate it, it can be done in 1 line

PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == PLAYER_STATE_PASSENGER && GetPlayerWeapon(playerid) == 24) return SetPlayerArmedWeapon(playerid0);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: