EQUIP POINT FOR RP SERVER - HELP
#1

I'm actually trying to make a /weaponequip command on the FBI rancher and if the boot is open.

Код:
if(sscanf(params, "ds", id, weap)) return SendClientMessage(playerid, COL_ERROR, "SERVER: /we(aponequip) (ID) smg|m4|sniper|deagle|armour");
Now, how can i make it that when i enter /weaponequip (ID) M4 - for example, it equips a M4 to a player's hand?

Код:
	if(IsAFBICar(vehicleid)
	{
	    if( boot == 0 ) return SendClientMessage(playerid, COL_ERROR, "SERVER: The boot of the Federal Rancher is not open!");
	    if( boot == 1 )
             I want help here
Reply
#2

how do you use " boot " ?

you need to use
PHP код:
 GetVehicleParamsEx(vehicleid, &engine, &lights, &alarm, &doors, &bonnet, &boot, &objective
here more info
Reply
#3

I meant..

if i enter /we id SMG
it equips SMG
if i enter /we id M4
it equips m4

I think i should use "case"s
Reply
#4

try it bro.

/weaponequip PlayerID WeaponID

PHP код:
CMD:weaponequip(playeridparams[])
{
    new 
GunIDpIDFloat:Pos[3], Float:distance;
    if(
sscanf(params"ui"pIDGunID)) return SendClientMessage(playeridCOL_ERROR"SERVER: /weaponequip [PlayerID] [WeaponID = (1:smg|2:m4|3:sniper|4:deagle|5:armour)");
    if(!
IsPlayerConnected(pID)) return SendClientMessage(playeridCOL_ERROR"SERVER: Player ID is invalid or do not exist!");
    
GetPlayerPos(pIDPos[0], Pos[1], Pos[2]);
    
distance GetPlayerDistanceFromPoint(playeridPos[0], Pos[1], Pos[2]),
    if(
distance 10.0) return SendClientMessage(playeridCOL_ERROR"SERVER: You need to be close of player to give his equipment!");
    
    if(!
IsAFBICar(vehicleid)) return SendClientMessage(playeridCOL_ERROR"SERVER: You're not in FBI Vehicle.");
    {
        if(!
boot) return SendClientMessage(playeridCOL_ERROR"SERVER: The boot of the Federal Rancher is not open!");
        {
            switch(
GunID)
            {
                case 
1:
                {
                    
GivePlayerWeapon(pID29250);
                       
SendClientMessage(playerid0x00FF00FF"* You get a SMG from vehicle boot!");
                   }
                  case 
2:
                  {
                      
GivePlayerWeapon(pID31400);
                      
SendClientMessage(playerid0x00FF00FF"* You get a M4 Rifle from vehicle boot!");
                  }
                  case 
3:
                  {
                      
GivePlayerWeapon(pID3430);
                      
SendClientMessage(playerid0x00FF00FF"* You get a Sniper Rifle from vehicle boot!");
                  }
                  case 
4:
                  {
                      
GivePlayerWeapon(pID24250);
                      
SendClientMessage(playerid0x00FF00FF"* You get a Desert Eagle from vehicle boot!");
                  }
                  case 
5:
                {
                       
SetPlayerArmour(pID100.0);
                       
SendClientMessage(playerid0x00FF00FF"* You get a Kevlar Armour from vehicle boot!");
                }
                default:
                {
                    return 
SendClientMessage(playeridCOL_ERROR"* You need to choose a option between 1 and 5.");
                }
            }
        }
    }
    return 
1;

Reply
#5

Great job, thank you!
Reply
#6

It actually doesn't work when on-foot and near the boot. Anyone can help? Please!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)