SA-MP Forums Archive
Commands - 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: Commands (/showthread.php?tid=378479)



Commands - God'Z War - 17.09.2012

Hey guys
i need your help

i am trying to make minigames Like Minigun

If Any one Typed Teleports Cmds . They will teleport With Minigun

in one server i saw : if any one typed cmd they will not teleport
it will show you should type /kill to exit dm


Re: Commands - antonio112 - 17.09.2012

I can't understand what do you mean. Please, use ****** translate or something so we can understand you.


Re: Commands - God'Z War - 17.09.2012

hmm i mean that
we cant use any cmd between the minigames
we should type /kill to exit


Re: Commands - mamorunl - 17.09.2012

If the player goes to a minigame set a variable (for instance: "inMinigame[playerid] = true"). Then in OnPlayerCommandText() -> Note: if you use it! Else disable it in the commands itself <- disable all commands except for /kill by checking if inMinigame[playerid] == true.


Re: Commands - God'Z War - 22.09.2012

See This One
pawn Код:
CMD:minigun(playerid,params[])
{
    new str[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    if(PlayerinMMDM[playerid] == 1) return SendClientMessage(playerid,red,"You are already in Minigun Madness DM. Type /exitmm to leave Minigun Madness");
    PlayerinMMDM[playerid] = 1;
    SetPlayerSkin(playerid,287);
    SetPlayerHealth(playerid,100);
    SetPlayerArmour(playerid,100);
    SetPlayerPos(playerid,3137.7678,-5204.4316,19.8778);
    SetPlayerInterior(playerid,0);
    GivePlayerWeapon(playerid,38,9999999999);
    format(str,sizeof(str),"%s has teleported to Minigun Madness [/MiniGun]",name);
    SendClientMessageToAll(green,str);
    SendClientMessage(playerid,yellow,"Teleported to Minigun Madness");
    return 1;
}
how i can disable other commends


Re: Commands - newbienoob - 22.09.2012

This is just an example
pawn Код:
CMD:heal(playerid,params[])
{
    if(PlayerinMMDM[playerid] == 1) return SendClientMessage(playerid,-1,"You can't heal yourself while in dm!");
    SetPlayerHealth(playerid,100);
    return 1;
}



Re: Commands - Pro_Drifter - 22.09.2012

Quote:
Originally Posted by God'Z War
Посмотреть сообщение
Hey guys
i need your help

i am trying to make minigames Like Minigun

If Any one Typed Teleports Cmds . They will teleport With Minigun

in one server i saw : if any one typed cmd they will not teleport
it will show you should type /kill to exit dm
You can use this:
pawn Код:
if(!strcmp(cmdtext, "/minigun", true) || !strcmp(cmdtext, "/minigun", true))
    {
       SetPlayerPos2(playerid, 3137.7678,-5204.4316,19.8778, cmdtext);
       SetPlayerWorldBounds(playerid, -459.0665, -628.7813, -464.1276, -567.4709);
       GivePlayerWeapon(playerid, 38, 8000);
       SetPlayerArmour(playerid, 100.0);
       SetPlayerHealth(playerid, 100);
       return 1;
    }
Thats All Very easy

Tell me if i helped


Re: Commands - God'Z War - 22.09.2012

Quote:
Originally Posted by newbienoob
Посмотреть сообщение
This is just an example
pawn Код:
CMD:heal(playerid,params[])
{
    if(PlayerinMMDM[playerid] == 1) return SendClientMessage(playerid,-1,"You can't heal yourself while in dm!");
    SetPlayerHealth(playerid,100);
    return 1;
}
pawn Код:
CMD:heal(playerid,params[])
{
    if(PlayerinMMDM[playerid] == 0) return SendClientMessage(playerid,-1,"You can't heal yourself while in dm!");
    SetPlayerHealth(playerid,100);
    return 1;
}
u should use 0 = disable
1= enable


Re: Commands - mamorunl - 22.09.2012

Quote:
Originally Posted by God'Z War
Посмотреть сообщение
CMD:heal(playerid,params[])
{
if(PlayerinMMDM[playerid] == 0) return SendClientMessage(playerid,-1,"You can't heal yourself while in dm!");
SetPlayerHealth(playerid,100);
return 1;
}
u should use 0 = disable
1= enable
So then your code is a failure you mean?