31.10.2010, 23:51
pawn Код:
if(strcmp(cmd, "/mp", true) == 0)
{
tmp = strtok(cmdtext, idx);
new tmp2[256] = strtok(cmd, idx); // se der erro aqui coloca new cmd[256]; antes dessa linha, por algum motivo os tmp q usam strtok tem q ser [256]
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF0000AA, "USO: /mp [ID] [Texto]");
return 1;
}
new ID;
ID = strval(tmp);
new texto = strval(tmp2);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF0000AA, "USO: /mp [ID] [Texto]");
return 1;
}
new Nome[MAX_PLAYER_NAME];
new String[128];
GetPlayerName(playerid, Nome, sizeof(Nome));
format(String, sizeof(String), "PM De %s: %s",Nome, texto);
SendClientMessage(ID,0xFFFF00AA,String);
return 1;
}

