aod cmd help
#3

Quote:
Originally Posted by Zedder
Посмотреть сообщение
you need to use a global variable for that such as:
PHP код:

new aod[MAX_PLAYERS];
OnPlayerConnect(playerid)
{
    
aod[playerid] = 0;//add this on playerconnect so that it will set 0 for all the players
    
return 1;
}
CMD:aod(playerid,params[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 1)  
    {
        if(
aod[playerid] == 0)
{
        
aod[playerid] = 1;
      
ResetPlayerWeapons(playerid); 
      
SendClientMessage(playerid,COLOR_GREY,"{1AE694}» {EA15D5}You're now on duty. (Dont abuse it"); 
      
GivePlayerWeapon(playerid,43,100);
      
SetPlayerSkin(playerid,294);
      
SetPlayerHealth(playerid,999999); 
      
SetPlayerColor(playerid,0xEA15D5C8);
      new 
Text3D:label Create3DTextLabel("ADMIN ON DUTY!"0xEA15D5C830.040.050.040.00);
        
Attach3DTextLabelToPlayer(labelplayerid0.00.00.7);
}
        else
{
       
SetPlayerSkin(playeridPlayerInfo[playerid][pSkin]);
       
SetPlayerHealth(playeridPlayerInfo[playerid][pHealth]);
       
SetPlayerArmour(playeridPlayerInfo[playerid][pArmour]);
      
SetPlayerColor(playerid0xFFFFFF00);
      
Delete3DTextLabel(label[playerid]);
     
aod[playerid] = 0//reset it to 0 so that they can use the cmd again
      //add more stuffs to reset or normalize as a normal player
}
    }
     else
    {
        
SendClientMessage(playeridCOLOR_RED"You are not allowed to use this cmd");
    }
    return 
1;

Sorry but i edited that inside the sa-mp forum, thats why there maybe some loose indentation warnings.
hay thnx it worked and u just teached me how to use those variable thingy +rep
Reply


Messages In This Thread
aod cmd help - by STRIKER19501 - 18.09.2017, 13:10
Re: aod cmd help - by Zedder - 18.09.2017, 13:55
Re: aod cmd help - by STRIKER19501 - 19.09.2017, 11:07

Forum Jump:


Users browsing this thread: 2 Guest(s)