17.11.2011, 20:52
pawn Код:
if(strcmp(cmd,"/anuncio",true)==0){
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
new tmp[256];
strmid(tmp,cmdtext,2,strlen(cmdtext));
if(!strlen(tmp)) {
SendClientMessage(playerid,Vermelho, "Digite: /anuncio [texto]");
return 1;
} else {
format(string, sizeof(string), "[Admin] %s diz: %s ", aname, tmp);
SendClientMessageToAll(0xAA3333AA,string);
return 1;
}
}else{
SendClientMessage(playerid,Vermelho,"[x] Vocк nгo tem acesso a esse comando!");
return 1;
}
}
:/
Aproveita q hj eu to bonzin '-'
pawn Код:
if(strcmp("/pm", cmd, true) == 0)
{
new tmp[256];
if(!strlen(tmp) || strlen(tmp) > 5) {
SendClientMessage(playerid,0xFFFF22AA,"Use: /pm [id] [messagen]");
return 1;
}
new id = strval(tmp);
if(!strlen(gMessage)) {
SendClientMessage(playerid,0xFFFF22AA,"Use: /pm [id] [messagen]");
return 1;
}
if(!IsPlayerConnected(id)) {
SendClientMessage(playerid,0xFFFF22AA,"- Id Invalido -");
return 1;
}
if(playerid != id) {
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
format(Message,sizeof(Message),">> %s(%d): %s",iName,id,gMessage);
SendClientMessage(playerid,0xFFCC2299,Message);
format(Message,sizeof(Message),"** %s(%d): %s",pName,playerid,gMessage);
SendClientMessage(id,0xFFFF22AA,Message);
PlayerPlaySound(id,1085,0.0,0.0,0.0);
printf("PM: %s",Message);
}
else {
SendClientMessage(playerid,0xFF444499,"Vocк nгo pode mandar pm para vocк mesmo.");
}
return 1;
}
pawn Код:
new Message[256];
new gMessage[256];
new pName[MAX_PLAYER_NAME+1];
new iName[MAX_PLAYER_NAME+1];