if(strcmp(cmd, "/pm", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] == 0 || PlayerInfo[playerid][pGameMaster] >= 1) { SendClientMessage(playerid, COLOR_WHITE, " Ne ste Ovlasteni za Ovaa Komanda!."); return 1; } if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_WHITE, " Ne Ste Logirani!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "KORISTI: /pm [ID/Ime Na Igrac] [text]"); return 1; } giveplayerid = ReturnUser(tmp); if(PlayerInfo[playerid][pAdmin] == 1 || PlayerInfo[playerid][pGameMaster] >= 1) { if (IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if(HidePM[giveplayerid] > 0) { SendClientMessage(playerid, COLOR_GREY, " "); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_WHITE, "KORISTI: /pm [ID/Ime Na Igrac] [text]"); return 1; } format(string, sizeof(string), "[ID:%d] %s pm you: %s", playerid, sendername, (result)); SendClientMessage(giveplayerid, COLOR_LIGHTRED, string); format(string, sizeof(string), "Pm Sent [ID:%d]%s: %s", giveplayerid, giveplayer, (result)); SendClientMessage(playerid, COLOR_LIGHTRED, string); return 1; } } else { format(string, sizeof(string), " %d Ne e Aktiven Igrac !.", giveplayerid); SendClientMessage(playerid, COLOR_GRAD1, string); } } } return 1; }
"KORISTI: /pm [ID/Ime Na Igrac] [text]" |
if(PlayerInfo[playerid][pAdmin] == 0 || PlayerInfo[playerid][pGameMaster] >= 1)
if(strcmp("/mp", cmd, true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, CINZENTO, "USO: /mp [Player-Id] [MENSAGEM]");
otherid = ReturnUser(tmp);
if(!IsPlayerConnected(otherid)) return SendClientMessage(playerid, CINZENTO, "Player Desconectado");
new message[128];
message = strrest(cmdtext, idx);
if(!strlen(message)) return SendClientMessage(playerid, CINZENTO, "USO: /mp [Player-Id] [MENSAGEM]");
if(strlen(message) > 55) return SendClientMessage(playerid, CINZENTO, "Mensagem Demasiado Grande");
if(otherid == playerid) return SendClientMessage(playerid, CINZENTO, "Vocк nгo pode enviar uma mensagem a si prуprio");
if(GetPlayerMoney(playerid) < 20) return SendClientMessage(playerid, CINZENTO, "Sem Dinheiro Suficiente ($20)");
format(string, sizeof(string), "Mensagem de: %s: %s", PlayerName(playerid), message);
SendClientMessage(otherid, AMARELO, string);
format(string, sizeof(string), "Enviado a %s: %s", PlayerName(otherid), message);
SendClientMessage(playerid, AMARELO, string);
GivePlayerMoney(playerid, -20);
return 1;
}