23.02.2010, 10:52
pawn Код:
new idx;
new tmp[256];
if(!strcmp(cmd, "/me",true) || !strcmp(cmd, "/mymessage",true))
{
new dir[256];
dir = strtok(cmdtext, idx);
strmid(tmp, cmdtext, 4, strlen(cmdtext));
if(!strlen(dir))
{
SendClientMessage(playerid,COLOR_PINK,"[USAGE]> /me [Message/Action]");
return 1;
}
dir = strtok(cmdtext, idx);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s(%d) Says: %s", sendername, playerid, tmp);
SendClientMessageToAll(COLOR_RED,string);
print(string);
return 1;
}
if(!strcmp(cmd, "/ad",true) || !strcmp(cmd, "/advertise",true))
{
new dir[256];
dir = strtok(cmdtext, idx);
strmid(tmp, cmdtext, 4, strlen(cmdtext));
if(!strlen(dir))
{
SendClientMessage(playerid,COLOR_PINK,"[USAGE]> /ad [Advertisement Name]");
return 1;
}
if (GetPlayerMoney(playerid) >= 499)
SendClientMessage(playerid,COLOR_RED,"You don't have 500$");
}
GetPlayerName(playerid,pName,sizeof(pName));
format(string,sizeof(string),"Advertisement: %s by [%s]",cmdtext,pName[7]);
SendClientMessageToAll(COLOR_ORANGE,string);
GivePlayerMoney(playerid, -500);
print(string);
return 1;
}
if(!strcmp(cmd, "/an",true) || !strcmp(cmd, "/adminmsg",true))
{
new dir[256];
dir = strtok(cmdtext, idx);
strmid(tmp, cmdtext, 4, strlen(cmdtext));
if(!strlen(dir))
{
SendClientMessage(playerid,COLOR_PINK,"[USAGE]> /an [Message]");
return 1;
}
dir = strtok(cmdtext, idx);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[ADMIN ANNOUNCE] %s(%d): %s", sendername, playerid, tmp);
SendClientMessageToAll(COLOR_RED,string);
print(string);
return 1;
}