SA-MP Forums Archive
Help me Please!!. - 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)
+--- Thread: Help me Please!!. (/showthread.php?tid=607660)



Help me Please!!. - TheseMan - 22.05.2016

Hello all, I have the command /w and /God, so when they activate /God, they can not use the command /w

And get a Message like this: you can't use Weapon, please turn off the Godmode

My /god Command:

Quote:

CMD:god(playerid)
{
if(gUser[playerid][U_MODE] != MODE_FREEROAM) return GameTextForPlayer(playerid, "~r~You must be in freeroam", 5000, 3);

if(gUser[playerid][U_GOD])
{
SetPlayerHealth(playerid, 100.0);
GameTextForPlayer(playerid, "~b~~h~~h~~h~Godmode ~w~~h~OFF", 5000, 3);
ResetPlayerWeapons(playerid);
}
else
{
SetPlayerHealth(playerid, FLOAT_INFINITY);
GameTextForPlayer(playerid, "~b~~h~~h~~h~Godmode ~w~~h~ON", 5000, 3);
ResetPlayerWeapons(playerid);
}
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
gUser[playerid][U_GOD] = (! gUser[playerid][U_GOD]);
return 1;
}

My Weapon Command:

Quote:

CMD:w(playerid)
{
if(gUser[playerid][U_MODE] != MODE_FREEROAM) return GameTextForPlayer(playerid, "~g~You Are Not In Freeroam", 5000, 3);

if(! IsPlayerSpawned(playerid)) return GameTextForPlayer(playerid, "~g~You must be spawned", 5000, 3);

ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons configurations/spawner", "Weapons list\nSpawn Weapons\nTools", "Select", "Close");
return 1;
}

Thanks For Help!


Re: Help me Please!!. - SyS - 22.05.2016

look in that thread where you posted the same before


Re: Help me Please!!. - TheseMan - 22.05.2016

Quote:
Originally Posted by Sreyas
View Post
look in that thread where you posted the same before
Really?, I don't know, Sorry... but Can You Help Me?


Re: Help me Please!!. - SyS - 22.05.2016

Here it is you posted it on that thread i replied :3 ah what ever im posting it again
Quote:
Originally Posted by TheseMan
View Post
Hello, can you do it in My Weapon commands?
PHP Code:
CMD:w(playerid)
{
if(
gUser[playerid][U_MODE] != MODE_FREEROAM) return GameTextForPlayer(playerid"~g~You Are Not In Freeroam"50003);
if(
gUser[playerid][U_GOD]) return GameTextForPlayer(playerid"~g~You Are In God mode"50003);
if(! 
IsPlayerSpawned(playerid)) return GameTextForPlayer(playerid"~g~You must be spawned"50003);
ShowPlayerDialog(playeridDIALOG_WEAPONSDIALOG_STYLE_LIST"Weapons configurations/spawner""Weapons list\nSpawn Weapons\nTools""Select""Close");
return 
1;




Re: Help me Please!!. - TheseMan - 22.05.2016

Quote:
Originally Posted by Sreyas
View Post
Here it is you posted it on that thread i replied :3 ah what ever im posting it again



PHP Code:
CMD:w(playerid)
{
if(
gUser[playerid][U_MODE] != MODE_FREEROAM) return GameTextForPlayer(playerid"~g~You Are Not In Freeroam"50003);
if(
gUser[playerid][U_GOD]) return GameTextForPlayer(playerid"~g~You Are In God mode"50003);
if(! 
IsPlayerSpawned(playerid)) return GameTextForPlayer(playerid"~g~You must be spawned"50003);
ShowPlayerDialog(playeridDIALOG_WEAPONSDIALOG_STYLE_LIST"Weapons configurations/spawner""Weapons list\nSpawn Weapons\nTools""Select""Close");
return 
1;

It Does Not Work


Re: Help me Please!!. - SyS - 22.05.2016

try to edit your god command may be that made it not working
PHP Code:
CMD:god(playerid)
{
if(
gUser[playerid][U_MODE] != MODE_FREEROAM) return GameTextForPlayer(playerid"~r~You must be in freeroam"50003);

if(
gUser[playerid][U_GOD])
{
SetPlayerHealth(playerid100.0);
GameTextForPlayer(playerid"~b~~h~~h~~h~Godmode ~w~~h~OFF"50003);
ResetPlayerWeapons(playerid);
PlayerPlaySound(playerid10570.00.00.0);
gUser[playerid][U_GOD] = false;
return 
1;
}
else
{
SetPlayerHealth(playeridFLOAT_INFINITY);
GameTextForPlayer(playerid"~b~~h~~h~~h~Godmode ~w~~h~ON"50003);
ResetPlayerWeapons(playerid);
PlayerPlaySound(playerid10570.00.00.0);
gUser[playerid][U_GOD] = true;
return 
1;
}




Re: Help me Please!!. - TheseMan - 22.05.2016

Quote:
Originally Posted by Sreyas
View Post
try to edit your god command may be that made it not working
PHP Code:
CMD:god(playerid)
{
if(
gUser[playerid][U_MODE] != MODE_FREEROAM) return GameTextForPlayer(playerid"~r~You must be in freeroam"50003);
if(
gUser[playerid][U_GOD])
{
SetPlayerHealth(playerid100.0);
GameTextForPlayer(playerid"~b~~h~~h~~h~Godmode ~w~~h~OFF"50003);
ResetPlayerWeapons(playerid);
PlayerPlaySound(playerid10570.00.00.0);
gUser[playerid][U_GOD] = false;
return 
1;
}
else
{
SetPlayerHealth(playeridFLOAT_INFINITY);
GameTextForPlayer(playerid"~b~~h~~h~~h~Godmode ~w~~h~ON"50003);
ResetPlayerWeapons(playerid);
PlayerPlaySound(playerid10570.00.00.0);
gUser[playerid][U_GOD] = true;
return 
1;
}

Not Working


Re: Help me Please!!. - SyS - 22.05.2016

something is fishy what is problem? is it giving any error ?


Re: Help me Please!!. - TheseMan - 22.05.2016

Quote:
Originally Posted by Sreyas
View Post
something is fishy what is problem? is it giving any error ?
There is no error, but when I tried in the game is not working.


Re: Help me Please!!. - SyS - 22.05.2016

hmm try it
PHP Code:
CMD:w(playerid

if(
gUser[playerid][U_MODE] != MODE_FREEROAM) return GameTextForPlayer(playerid"~g~You Are Not In Freeroam"50003); 
if(
gUser[playerid][U_GOD] == true) return GameTextForPlayer(playerid"~g~You Are In God mode"50003); 
if(! 
IsPlayerSpawned(playerid)) return GameTextForPlayer(playerid"~g~You must be spawned"50003); 

ShowPlayerDialog(playeridDIALOG_WEAPONSDIALOG_STYLE_LIST"Weapons configurations/spawner""Weapons list\nSpawn Weapons\nTools""Select""Close"); 
return 
1