How to fix this cmd?
#3

PHP код:
CMD:m(playeridparams[])
{
    if(
strcmp(cmd"/megaphone"true) == || strcmp(cmd"/m"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            new 
type FactionInfo[PlayerInfo[playerid][pMember]][FactionType];
            new 
tmpcar GetPlayerVehicleID(playerid);
            
GetPlayerName(playeridsendernamesizeof(sendername));
            new 
length strlen(cmdtext);
            while ((
idx length) && (cmdtext[idx] <= ' '))
            {
                
idx++;
            }
            new 
offset idx;
            new 
result[64];
            while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
            {
                
result[idx offset] = cmdtext[idx];
                
idx++;
            }
            
result[idx offset] = EOS;
            if(!
strlen(result))
            {
                
SendClientMessage(playeridCOLOR_WHITE"USAGE: (/m)egaphone [megaphone chat]");
                return 
1;
            }
            if(
IsACop(playerid) || PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 4|| IsASoldier(playerid) || IsAnAgent(playerid) || IsAMedic(playerid))
            {
                if(!
IsACopCar(tmpcar) && !IsAnAmbulance(tmpcar) && !IsANGCar(tmpcar))
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"   You are not in a Government vehicle !");
                    return 
1;
                }
                else if(
IsACop(type))
                {
                    
format(stringsizeof(string), "[Officer %s:o< %s]"sendernameresult);
                    
ProxDetector(60.0playeridstring,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                }
                else if(
IsAnAgent(playerid))
                {
                    
format(stringsizeof(string), "[Agent %s:o< %s]"sendernameresult);
                    
ProxDetector(60.0playeridstring,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                }
                else if(
IsAMedic(playerid))
                {
                    
format(stringsizeof(string), "[Doctor %s:o< %s]"sendernameresult);
                    
ProxDetector(60.0playeridstring,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                }
                else if(
IsASoldier(playerid))
                {
                    
format(stringsizeof(string), "[Soldier %s:o< %s]"sendernameresult);
                    
ProxDetector(60.0playeridstring,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD2"   You are not part of a Faction !");
                return 
1;
            }
        }
        return 
1;

Reply


Messages In This Thread
How to fix this cmd? - by SniperZLyfe1 - 07.09.2017, 17:07
Re: How to fix this cmd? - by 10MIN - 07.09.2017, 17:23
Re: How to fix this cmd? - by n00blek - 07.09.2017, 17:24
Re: How to fix this cmd? - by SniperZLyfe1 - 07.09.2017, 17:29
Re: How to fix this cmd? - by 10MIN - 07.09.2017, 17:31
Re: How to fix this cmd? - by SniperZLyfe1 - 07.09.2017, 17:42
Re: How to fix this cmd? - by 10MIN - 07.09.2017, 17:45
Re: How to fix this cmd? - by Primes007 - 07.09.2017, 20:13

Forum Jump:


Users browsing this thread: 1 Guest(s)