Tessék:
[pawn]#include a_samp
#include zcmd
#define Msg(%0) SendClientMessage(playerid, -1, %0)
#define PRESSED(%0) \\
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
new bool:rendor[MAX_PLAYERS];
CMD:rendor(playerid,params[]) {
if(rendor[playerid] == false) {
rendor[playerid] = true;
Msg(\"Rendõr lettél.\");
} else if(rendor[playerid] == true) {
rendor[playerid] = false;
Msg(\"Már nem vagy rendõr.\");
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_SUBMISSION)) {
if(rendor[playerid] == true) {
new Float:x, Float:y, Float:z;
for (new ID; ID < MAX_PLAYERS; ID++) {
if (IsPlayerConnected(ID)) {
if (IsPlayerInRangeOfPoint(playerid, 25.0, x, y, z)) {
if (GetPlayerWantedLevel(ID) > 0) {
SetPlayerWantedLevel(ID, 0);
}
}
}
}
} else {
Msg(\"Nem vagy rendõr\");
}
}
return 1;
}[/pawn]