28.09.2011, 18:45
I would like to do in chat rooms so that they appointed / cb ...... and that the player would type / cb 1 would be transferred into that room and that others would not see how this would naredul
CMD:changeroom(playerid, params[])
{
new room;
if(sscanf(params,"i",room))
return SendClientMessage(playerid, -1, "Usage: /cb [room]");
else
{
//Send a message showing that he changes the room!
Room[playerid] = room;
}
}
CMD:cb(playerid, params[])
{
new text[128];
if(sscanf(params, "s",text))
return //Usage: bla bla bla
else
{
format(string,sizeof(string), "[Room %d]%s Says: %s",Room[playerid], PLAYERNAME, text);//you must get the player name or use a stock if you have...
for(new i=0; i<MAXPLAYERS; i++)
{
if(Room[i] == Room[playerid])
SendClientMessage(i, -1, string);
}
}
return 1;
}
pawn Код:
|