help me +rep[
#1

Hello look
In my server i have /god cmd and /wshop where u can buy weapons,So I dont want when a player has typed /god to be able to type /wshop too and i made this code.
Код:
CMD:wshop(playerid, params[]){
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Weapon Shop", "Colt 45 ($75,000)\nDesert Eagle ($90,000)\nShotgun ($20,000)\nSawnoff Shotgun ($40,500)\nCombat Shotgun ($80,000)\nMicro SMG ($80,000)\nTec9 ($100,800)\nMP5 ($100,000)\nAK-47 ($300,000)\nM4 ($190,500)\nCountry Rifle ($150,000)\nSniper Rifle ($200,500)\nHeat-Seaking Rocket ($650,000)\nFlamethrower ($500,000)\nMinigun ($600,500)\nRPG ($700,000)\nParachute ($1.000)\n", "Buy!", "Cancel");
if(GetPlayerHealth(playerid) > 100) return SendClientMessage(playerid,COLOR_RED,"You cant use /god and /wshop together.Turn off your gode mode and then buy weapons");
return 1;}
Help me please it doestn works.
Reply
#2

Make A Variable For God Command, Like This In the Top of the script:
pawn Код:
new godmode[MAX_PLAYERS];
Then, in the god command, do this:
pawn Код:
godmode[playerid] = 1;
that will make the player's value to 1 it is used if enabling the god mode, while disabling it use:
pawn Код:
godmode[playerid] = 0;
, and it will set it to the value 0 (default).

and in the command wshop do this:
pawn Код:
CMD:wshop(playerid, params[]){
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Weapon Shop", "Colt 45 ($75,000)\nDesert Eagle ($90,000)\nShotgun ($20,000)\nSawnoff Shotgun ($40,500)\nCombat Shotgun ($80,000)\nMicro SMG ($80,000)\nTec9 ($100,800)\nMP5 ($100,000)\nAK-47 ($300,000)\nM4 ($190,500)\nCountry Rifle ($150,000)\nSniper Rifle ($200,500)\nHeat-Seaking Rocket ($650,000)\nFlamethrower ($500,000)\nMinigun ($600,500)\nRPG ($700,000)\nParachute ($1.000)\n", "Buy!", "Cancel");
if(godmode[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"You cant use /god and /wshop together.Turn off your gode mode and then buy weapons");
return 1;}
That will check if the player's godmode value is to 1,if it is to 1,then it will send the message,if its not,then its working.
Reply
#3

thanks you thanks you very very much.rep given.
Reply
#4

oh and i almost forgot, do
pawn Код:
godmode[playerid] = 0;
under the callback: OnPlayerDisconnect
Reply
#5

it still open /wshop any other idea?
Reply
#6

oh sorry didn't check this
Reply
#7

ok do it if possible man.
Reply
#8

Hello, can you do it in My Weapon commands?

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;
}

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;
}

Reply
#9

Quote:
Originally Posted by TheseMan
Посмотреть сообщение
Hello, can you do it in My Weapon commands?
PHP код:
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;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)