Reports Questions Send only for DutyOn Admins?
#1

Hello , i have no Idea how to Make that: The Reports are send only for DutyOn Admins.
this is /adminduty Command:
PHP Code:
if(strcmp(cmd"/adminduty"true) == || strcmp(cmd"/aod"true) == || strcmp(cmd"/aduty"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"You are not Connected !");
                return 
1;
            }
            if(
PlayerInfo[playerid][pAdmin] > 0)
            {
                if(
AdminDuty[playerid] == 0)
                {
                    
AdminDuty[playerid] = 1;
                    
SetPlayerArmour(playerid999);
                    
SetPlayerHealth(playerid999);
                    
SetPlayerColor(playeridCOLOR_LIGHTRED);
                    
GetPlayerName(playeridsendernamesizeof(sendername));
                    
format(stringsizeof(string), "[DUTY] %s Is now OnDuty"sendername);
                    
ABroadCast(COLOR_LIGHTRED,string,1);
                    if(
PlayerInfo[playerid][pAdmin] >= 1339)
                    
SafeGivePlayerWeapon(playerid3811000);
                    {
                        for(new 
0sizeof(CarInfo); i++)
                        {
                            
SetVehicleParamsForPlayer(i,playerid,0,0);
                        }
                    }
                    return 
1;
                }
                else if(
AdminDuty[playerid] == 1)
                {
                    
AdminDuty[playerid] = 0;
                    
SetPlayerArmour(playerid0);
                    
SetPlayerHealth(playerid100);
                    
SafeResetPlayerWeapons(playerid);
                    
SetPlayerColor(playerid,COLOR_WHITE);
                    
GetPlayerName(playeridsendernamesizeof(sendername));
                    
format(stringsizeof(string), "[DUTY] %s Is OffDuty"sendername);
                    
ABroadCast(COLOR_LIGHTRED,string,1);
                    return 
1;
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_BLUE"You Can Not do that");
                return 
1;
            }
        }
        return 
1;
    } 
And this is Report command:
PHP Code:
if(strcmp(cmd"/report"true) == 0
    {
    if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /report [ID] [Reason]");
                return 
1;
            }
            
giveplayerid strval(tmp);
            
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
            if(
IsPlayerConnected(giveplayerid))
            {
                if(
giveplayerid != INVALID_PLAYER_ID)
                {
                       new 
length strlen(cmdtext);
                    while ((
idx length) && (cmdtext[idx] <= ' '))
                    {
                        
idx++;
                    }
                    new 
offset idx;
                    new 
result[128];
                    while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                    {
                        
result[idx offset] = cmdtext[idx];
                        
idx++;
                    }
                    
result[idx offset] = EOS;
                    if(!
strlen(result))
                    {
                        
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /report [ID of the Player] [Reason]");
                        return 
1;
                    }
                     
format(stringsizeof(string), "%s (%d) reported %s (%d)Reason: %s",sendernameplayeridgiveplayergiveplayerid, (result));
                    
ABroadCast(COLOR_LIGHTRED,string,1);
                    
SendClientMessage(playeridCOLOR_YELLOW"Your Rapport Was Send to Online Admins.");
                }
               }
               else
            {
                
SendClientMessage(playeridCOLOR_GREY"This Player isn't Connected !");
                return 
1;
            }
        }
        return 
1;
    } 
Thanks .
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)