SA-MP Forums Archive
Removeing weapons - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Removeing weapons (/showthread.php?tid=135277)



Removeing weapons - abineri - 19.03.2010

I need to remove the wepons the player gets when he uses the /quitduty command or gets jailed however i have tryed ResetPlayerWeapons(playerid); and it dosent work and i saw a function called RemovePlayerWeapon(playerid, weaponid) but i cant get that to work eather

Quote:

if (strcmp("/quitduty", cmdtext, true, 10) == 0)
{
if((police) == 1)
{
police = 0;
SetJob(0,playerid);
SetPlayerSkin( playerid, Skin[ playerid ] );
ResetPlayerWeapons(playerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are off duty");
SetPlayerColor(playerid, COLOR_WHITE);

}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You arent on duty!");
}
return 1;
}
return 0;
}




Re: Removeing weapons - Goobiiify - 19.03.2010

https://sampwiki.blast.hk/wiki/ResetPlayerWeapons


Re: Removeing weapons - abineri - 19.03.2010

Quote:
Originally Posted by Goobii
I tryed that but it didnt work


Re: Removeing weapons - abineri - 19.03.2010

Quote:
Originally Posted by Goobii
when the person is jailed or quits duty they still have the weapons they where given when they go on duty


Re: Removeing weapons - [LSR]State_Trooper - 19.03.2010

ResetPlayerWeapons(playerid);

Add that to your off duty command etc.


Re: Removeing weapons - abineri - 19.03.2010

Quote:
Originally Posted by [LSR
State_Trooper ]
ResetPlayerWeapons(playerid);

Add that to your off duty command etc.
i have yet it still dosent work take alook at my off duty command in my frist post


Re: Removeing weapons - [LSR]State_Trooper - 20.03.2010

Код:
if (strcmp("/quitduty", cmdtext, true, 10) == 0) 
  {
    if((police) == 1) 
    ResetPlayerWeapons(playerid);
    {
    police = 0; 
    SetJob(0,playerid);
    SetPlayerSkin( playerid, Skin[ playerid ] );
    ResetPlayerWeapons(playerid);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are off duty");
   SetPlayerColor(playerid, COLOR_WHITE);

   }
   else
   {
   SendClientMessage(playerid, COLOR_LIGHTBLUE, "You arent on duty!");
   }
   return 1;
    }
  return 0;
   }
Try that!!


Re: Removeing weapons - abineri - 20.03.2010

Quote:
Originally Posted by [LSR
State_Trooper ]
Код:
if (strcmp("/quitduty", cmdtext, true, 10) == 0) 
 {
   if((police) == 1) 
   ResetPlayerWeapons(playerid);
   {
   police = 0; 
   SetJob(0,playerid);
    SetPlayerSkin( playerid, Skin[ playerid ] );
    ResetPlayerWeapons(playerid);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are off duty");
   SetPlayerColor(playerid, COLOR_WHITE);

   }
   else
   {
   SendClientMessage(playerid, COLOR_LIGHTBLUE, "You arent on duty!");
   }
   return 1;
    }
 return 0;
   }
Try that!!
tryed that it still didnt work i still have all the weapons take a look at the duty and off duty commands
[quote]
if (strcmp("/duty", cmdtext, true, 10) == 0)
{
if((wanted) == 1)
{
police = 0;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are wanted so you cant be a cop");
return 1;
}

if((police) == 0)
{
police = 1;
SetJob(1,playerid);
GivePlayerWeapon(playerid, 24, 70);
GivePlayerWeapon(playerid, 3, 0);
GivePlayerWeapon(playerid, 41, 700);
SetPlayerColor(playerid,COLOR_LIGHTBLUE);
SetPlayerSkin(playerid,280,284);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are now on duty");
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are all ready on duty");
}
return 1;
}
[/quote}
That is my duty command and my off duty command is in the first post


Re: Removeing weapons - abineri - 20.03.2010

bump ><


Re: Removeing weapons - XGh0stz - 20.03.2010

It doesn't make much sense, ResetPlayerWeapons(playerid) works just fine, so maybe the command isn't being executed at all?

When this command is used, do you get the 'You are off duty' message?