23.09.2011, 07:51
Hello all please how i can when player do /joingroup
and use then /pmg to talk
only who in InGroup can see!
and use then /pmg to talk
only who in InGroup can see!
Код:
if(strcmp(cmd, "/joingroup", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "USAGE: /joingroup (id)"); return 1; } if(!IsNumeric(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "USAGE: /joingroup (id) ID Must be a number"); return 1; } giveplayerid = strval(tmp); if(InGroup[playerid] == 1){ SendClientMessage(playerid,COLOR_ERROR,"You are already in group!"); return 1; } if(GroupInvit[giveplayerid] == 0){ format(string,sizeof(string),"You are not invited to Group (ID:%d)",giveplayerid); return 1; } if(GroupOwner[giveplayerid] == 0){ format(string,sizeof(string),"This player is dont have his own group!"); return 1; } new pname[24]; new oname[24]; GetPlayerName(playerid,pname,24); GetPlayerName(giveplayerid,oname,24); for(new i=0;i<MAX_PLAYERS;i++){ if(InGroup[i] == 1 && i != playerid){ format(string,sizeof(string),"%s(%d) Has Joined Pming Group",pname,playerid); SendClientMessage(i,COLOR_GREEN,string); format(string,sizeof(string),"You have joing Pming Group (ID:%d)",giveplayerid); SendClientMessage(playerid,COLOR_GREEN,string); InGroup[playerid] =1; GroupInvit[playerid] =0; } } return 1; }