Command NOT working
#1

hi i have got this command it compiles fine but when i go ingame it doesn't work Here:

--------------------------------------------
}
dcmd(c,1,cmdtext);
return 1;
}

dcmd_c(playerid,params[])
{
if(IsPlayerClan(playerid))
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerClan(i))
{
new string[1024];
new name[256];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"Clan Chat- %s: %s",name,params);
SendClientMessage(i,0x0033FFFF,string);
}
}
return 1;
------------------------------------------------

Please help me
Reply
#2

sorry for double post but someone help meh out
Reply
#3

pawn Код:
dcmd_c(playerid,params[])
{
    if(IsPlayerClan(playerid)) // This seems a little pointless, you could do it this way:
    if(!IsPlayerClan(playerid)) return SendClientMessage(playerid,red,"You need to be in a clan");
    new string[1024]; // Try not to create so many local scoped variables in loops, there's no need for so much memory allocation and de-allocation so many times, the same space in memory should be re-used.
    new name[256];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerClan(i))
        {
            GetPlayerName(playerid,name,sizeof(name));
            format(string,sizeof(string),"Clan Chat- %s: %s",name,params);
            SendClientMessage(i,0x0033FFFF,string);
        }
    }
    return 1;
} // Forgot a bracket...
Reply
#4

it still wont work..
Reply
#5

Quote:
Originally Posted by kvsolga
Посмотреть сообщение
it still wont work..
That's not much help, I need to know what's wrong. What happens?

Also where did you put this in your script?

pawn Код:
dcmd(c,1,cmdtext);
return 1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)