09.03.2018, 16:43
Ok i made it like this:
CMD:god(playerid, params[])
{
if(GodMode[playerid] == 0)
{
GodMode[playerid] = 1;
SendClientMessage(playerid, -1, "You're now on duty");
SetPlayerArmedWeapon(playerid, 0);
ResetPlayerWeapons(playerid);
}
else
{
if(GodMode[playerid] == 1)
{
GodMode[playerid] = 0;
SendClientMessage(playerid,-1,"You're now off duty");
}
return 1;
}
And i think that should work: I added ResetPlayerWeapons(playerid);
And this should reset weapons if he have when it launch the command.
But i have other problem, how do i make when player gets weapon it removes it again? When its god mode.
CMD:god(playerid, params[])
{
if(GodMode[playerid] == 0)
{
GodMode[playerid] = 1;
SendClientMessage(playerid, -1, "You're now on duty");
SetPlayerArmedWeapon(playerid, 0);
ResetPlayerWeapons(playerid);
}
else
{
if(GodMode[playerid] == 1)
{
GodMode[playerid] = 0;
SendClientMessage(playerid,-1,"You're now off duty");
}
return 1;
}
And i think that should work: I added ResetPlayerWeapons(playerid);
And this should reset weapons if he have when it launch the command.
But i have other problem, how do i make when player gets weapon it removes it again? When its god mode.