Help please
#7

pawn Код:
if(!strcmp(cmdtext, "/r", true, 2))
    {
        if(mechanic[playerid] < 1) return SendClientMessage(playerid,RED,"You are not a mechanic!");
        if(!cmdtext[2]) return SendClientMessage(playerid, RED, "USAGE: /r [chat]");
        new string[128],name[24];
        GetPlayerName(playerid,name,sizeof(name));
        for(new mechanics;mechanics < MAX_PLAYERS; mechanics++)
        {
            if(IsPlayerConnected(mechanics))
            {
                if(mechanic[mechanics] >= 1)
                {
                    format(string,sizeof(string),"Mechanic %s Says: %s",name,cmdtext[3]);
                    SendClientMessage(mechanics,color,string);
                }
             }
         }
         return 1;
     }
That is basically creating a loop trough all players which are connected,and checks if they are mechanics,if they are,it sends them the message,if they aren't,nothing happens.
Reply


Messages In This Thread
Help please - by bartje01 - 13.07.2010, 19:24
Re: Help please - by Hiddos - 13.07.2010, 19:25
Re: Help please - by bartje01 - 13.07.2010, 19:34
Re: Help please - by oliverrud - 13.07.2010, 19:52
Re: Help please - by bartje01 - 13.07.2010, 19:57
Re: Help please - by oliverrud - 13.07.2010, 19:57
Re: Help please - by [XST]O_x - 13.07.2010, 19:59
Re: Help please - by bartje01 - 13.07.2010, 20:55
Re: Help please - by [XST]O_x - 13.07.2010, 21:13

Forum Jump:


Users browsing this thread: 1 Guest(s)