12.02.2014, 19:44
tipo o cara digita /pm ae digita o id da pessoal e a mesagem ajuda
if(strcmp(cmd, "/mp", true) == 0 || strcmp(cmd, "/par", true) == 0)
{
if(PlayerInfo[playerid][pJailed] != 0)
{
SendClientMessage(playerid,COLOR_GREY,"Vocк nгo pode mandar particular PRESO!");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Vocк nгo pode falar, pois foi calado");
return 1;
}
if(IsPlayerConnected(playerid))
{
/*if(PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GREY, "Voce nгo й um admin!");
return 1;
}
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342)
{
SendClientMessage(playerid, COLOR_AMARELOR, "Vocк nгo estб trabalhando! (/pa)");
return 1;
}*/
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: (/mp) [id] [texto]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[giveplayerid][pAdmin] < 1)
{
SendClientMessage(playerid, VERMELHO, "Voce nгo й um admin ou o player que vocк digitou nгo й admin!");
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
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_GRAD2, "USE: (/mp) [id] [texto]");
return 1;
}
if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
{
format(string, sizeof(string), "Adolf_Hitler MP: %s", (result));
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
}
else
{
format(string, sizeof(string), "%s(ID: %d) MP: %s", sendername, playerid, (result));
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
}
print(string);
format(string, sizeof(string), "MP enviada para %s(ID: %d).", giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "[%d/%d/%d] [%d:%d:%d] MP: %s para %s: %s.", v[2], v[1], v[0], v[3], v[4], v[5] , PlayerName(playerid), PlayerName(giveplayerid), (result));
AChatLog(string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Esse jogador estб off-line.");
}
}
return 1;
}
// STRCMP
if(strcmp(cmd, "/mp", true) == 0)
{
new id, msg[128];
if(sscanf(cmdtext, "us[128]", id, msg))
return SendClientMessage(playerid, COLOR_GRAD2, "USE: (/mp) [id] [texto]");
if(!IsPlayerConnected(id))
return SendClientMessage(playerid, COLOR_GRAD1, " Esse jogador estб off-line.");
new string[128], player[MAX_PLAYER_NAME], obj[MAX_PLAYER_NAME];
GetPlayerName(playerid, player, sizeof(player));
GetPlayerName(id, obj, sizeof(obj));
format(string, sizeof(string), "MP enviada para %s(ID: %d). Msg: %s", obj, id, msg);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "MP recebida de %s(ID: %d). Msg: %s", player, playerid, msg);
SendClientMessage(id, COLOR_YELLOW, string);
return 1;
}
// ZCMD
CMD:mp(playerid, params[])
{
if(sscanf(params, "us[128]", params[0], params[1]))
return SendClientMessage(playerid, COLOR_GRAD2, "USE: (/mp) [id] [texto]");
if(!IsPlayerConnected(params[0]))
return SendClientMessage(playerid, COLOR_GRAD1, " Esse jogador estб off-line.");
new string[128], player[MAX_PLAYER_NAME], obj[MAX_PLAYER_NAME];
GetPlayerName(playerid, player, MAX_PLAYER_NAME);
GetPlayerName(params[0], obj, MAX_PLAYER_NAME);
format(string, sizeof(string), "MP enviada para %s(ID: %d). Msg: %s", obj, params[0], params[1]);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "MP recebida de %s(ID: %d). Msg: %s", player, playerid, params[1]);
SendClientMessage(params[0], COLOR_YELLOW, string);
return 1;
}