04.10.2010, 02:24
pawn Код:
if (strcmp("/barsell", cmdtext, true, 5) == 0)
{
new tmp[30];
tmp = strtok(cmdtext, idx);
new otherplayer = strval(tmp);
if(IsPlayerConnected(otherplayer))
{
new str[128];
new othername[24];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(otherplayer, othername, sizeof(othername));
format(str, sizeof(str), "%s Gave %s a Drink", sendername, othername);
SendClientMessageToAll(0xC2A2DAAA, str);
format(str, sizeof(str), "%s Gave You a Drink", sendername);
SendClientMessage(otherplayer,0xC2A2DAAA,str);
// maybe more code here? what does drinking do to the player?
return 1;
}
SendClientMessage(playerid,0xC2A2DAAA,"Invalid player");
return 1;
}