Help in scripting..
#1

I have made a cmd for my server /sniperdm and /minigundm

When a player type /minigundm he gets minigun weapon and again if he types /sniperdm he have sniper gun + minigun weapon..

I want you guys to help me by saying how to script something like when they type /minigundm and then /sniperdm it must say type /leave first and when they type /minigundm other all weapons must be disarmed..

Sorry for disturbing .. i am a beginner for scripting .. I request you to kindly help me
Reply
#2

Just use ResetPlayerWeapons first and then GivePlayerWeapon to disarm all other weapons when a player types /sniperdm or /minigundm.
Reply
#3

Use a boolean array to check, first declare a global one in the top of your script:
pawn Код:
new bool:MinigunDM[MAX_PLAYERS];
A boolean can have 2 values, true/false (set to false by default), so in your command, set it to true.
pawn Код:
CMD:minigundm(playerid, params[])
{
    if(MinigunDM[playerid]) return SendClientMessage(playerid, -1, "Type /leave to leave minigun DM");
    // If MinigunDM is set to true, stop the rest of the cmd using "return", and send the player a message
    MinigunDM[playerid] = true;
    // If the command hasn't been stopped, it will set MinigunDM to true
    // Other codes
}
And then set it to false in your /leave command if it's set to true.
Reply
#4

Calvin They one for Disarming?
Reply
#5

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
Just use ResetPlayerWeapons first and then GivePlayerWeapon to disarm all other weapons when a player types /sniperdm or /minigundm.
What I meant was this:
PHP код:
CMD:minigundm(playeridparams[])
{
    
ResetPlayerWeapons(playerid);
    
GivePlayerWeapons(playeridWEAPON_MINIGUNammo);
    
//remaining code
}
and
CMD:sniperdm(playeridparams[])
{
    
ResetPlayerWeapons(playerid);
    
GivePlayerWeapons(playeridWEAPON_SNIPERammo);
    
//remaining code

This will reset all weapons when a player joins a dm.
Reply
#6

Quote:
Originally Posted by fuckingcruse
Посмотреть сообщение
Calvin They one for Disarming?
ATOggy told you how to disarm a player.
Reply
#7

can i get a clear information about the /leave CMD?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)