10.09.2014, 23:49
Hello,
I'v pm system, but some players abuse it, such as send to other people IP's , can i make anti Ad, which return 0; or kick player?, this is the cmd:
I'v pm system, but some players abuse it, such as send to other people IP's , can i make anti Ad, which return 0; or kick player?, this is the cmd:
Код:
CMD:pm(playerid, params[])
{
if(time2[playerid] > gettime()) return GameTextForPlayer(playerid,"~b~Please Wait 5 Seconds!",2000,3);
new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
if(sscanf(params, "us", id, str2))
{
GameTextForPlayer(playerid,"~Y~/pm ~R~<id> <message>~N~~Y~/pms ~W~to ~G~enable ~W~/~R~disable ~W~the messages",5000,3);
return 1;
}
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
if(GetPVarInt(id, "PMEnabled") == 0) return GameTextForPlayer(playerid, "~n~~n~~r~Player Disabled PM", 3000, 5);
if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!");
{
GetPlayerName(playerid, Name1, sizeof(Name1));
GetPlayerName(id, Name2, sizeof(Name2));
format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2);
SendClientMessage(playerid, Yellow, str);
GameTextForPlayer(id,"~N~~N~~N~~N~~N~~N~~N~~b~You got a new message!",3000,3);
format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
SendClientMessage(id, Green, str);
time2[playerid] = gettime() +5;
}
return 1;
}

