Itt van remelem megy.Nem teszteltem es nem vagyok pro.
[pawn]//Rendõr parancsok by Depi
//Mindenjog fenttartva © 2009
//Parancsokért /d-policehelp
#include <a_samp>
#if defined FILTERSCRIPT
#define FILTERSCRIPT
#define COLOR_AQUA 0x7CFC00AA
#define COLOR_BLUEAQUA 0x7E60FFAA
#define COLOR_DARKBLUE 0x15005EAA
#define COLOR_ULTRARED 0xFF0606FF
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Rendõr parancsok betöltve by Depi\");
print(\"--------------------------------------\\n\");
return 1;
}
#endif
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid,0xFF0606FF,\"Rendõr parancsok betöltve\");
SendClientMessage(playerid,0xFF0606FF,\"Parancsokért: /d-policehelp\");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new cmd[128], idx;
cmd = strtok(cmdtext, idx);new tmp[256];
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new giveplayerid;
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
new playerskin[MAX_PLAYERS];
playerskin[playerid] = GetPlayerSkin(playerid);
if (strcmp(\"/d-policehelp\", cmdtext, true, 10) == 0)
{
if (playerskin[playerid] == 280) {
SendClientMessage(playerid,0x7CFC00AA,\"Rendõr parancsok:\");
SendClientMessage(playerid,0x7E60FFAA,\"/d-sokkol [id]\");
SendClientMessage(playerid,0x7E60FFAA,\"/d-kotozes [id]\");
SendClientMessage(playerid,0x7E60FFAA,\"/d-kioldoz [id]\");
SendClientMessage(playerid,0x7E60FFAA,\"/d-papirok [id]\");
SendClientMessage(playerid,0x7E60FFAA,\"/d-alj [id]\");
} else {
SendClientMessage(playerid,0x7E60FFAA,\"Neked nem szabad!\");
}
return 1;
}
if (strcmp(\"/d-sokkol\", cmdtext, true, 10) == 0)
{
new params[128];
params = strtok(cmdtext, idx);
if(!strlen(params))
return
SendClientMessage(playerid, 0x15005EAA, \"Használat: /d-sokkol [id]\");
new givenid = strval(params);
if (playerskin[playerid] == 280) {
if(IsPlayerConnected(givenid)) SetPlayerHealth(givenid,-25);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), \"%s Sokkolva lett egy rendõr által.\", giveplayer,giveplayerid);
SendClientMessageToAll(0x15005EAA, string);
} else {
SendClientMessage(playerid,0x15005EAA,\"Nincs a szerveren akit sokkolni akartál.\");
}
return 1;
}
if (strcmp(\"/d-kotozes\", cmdtext, true, 10) == 0)
{
new params[128];
params = strtok(cmdtext, idx);
if(!strlen(params))
return
SendClientMessage(playerid, 0x15005EAA, \"Használat: /d-kotozes [id]\");
new givenid = strval(params);
if (playerskin[playerid] == 280) {
if(IsPlayerConnected(givenid)) TogglePlayerControllable ( playerid, false );
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), \"%s Meg lett kötözve egy rendõr által.\", giveplayer,giveplayerid);
SendClientMessageToAll(0x15005EAA, string);
} else {
SendClientMessage(playerid,0x15005EAA,\"Nincs a szerveren akit kötözni akartál.\");
}
return 1;
}
if (strcmp(\"/d-kioldoz\", cmdtext, true, 10) == 0)
{
new params[128];
params = strtok(cmdtext, idx);
if(!strlen(params))
return
SendClientMessage(playerid, 0x15005EAA, \"Használat: /d-kioldoz [id]\");
new givenid = strval(params);
if (playerskin[playerid] == 280) {
if(IsPlayerConnected(givenid)) TogglePlayerControllable ( playerid, true );
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), \"%s Ki lettél oldozva egy rendõr által.\", giveplayer,giveplayerid);
SendClientMessageToAll(0x15005EAA, string);
} else {
SendClientMessage(playerid,0x15005EAA,\"Nincs a szerveren akit ki akartál oldozni.\");
}
return 1;
}
if (strcmp(\"/d-papirok\", cmdtext, true, 10) == 0)
{
new params[128];
params = strtok(cmdtext, idx);
if(!strlen(params))
return
SendClientMessage(playerid, 0x15005EAA, \"Használat: /d-papirok [id]\");
new givenid = strval(params);
if (playerskin[playerid] == 280) {
if(IsPlayerConnected(givenid)) SendClientMessage(playerid,0x15005EAA,\"Kérem mutassa a papírjait\");
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), \"%s Egy Rendõr elkérte a papírjait.\", giveplayer,giveplayerid);
SendClientMessageToAll(0x15005EAA, string);
} else {
SendClientMessage(playerid,0x15005EAA,\"Nincs a szerveren akitõl elkérted a papírokat.\");
}
return 1;
}
if (strcmp(\"/d-alj\", cmdtext, true, 10) == 0)
{
new params[128];
params = strtok(cmdtext, idx);
if(!strlen(params))
return
SendClientMessage(playerid, 0x15005EAA, \"Használat: /d-alj [id]\");
new givenid = strval(params);
if (playerskin[playerid] == 280) {
if(IsPlayerConnected(givenid)) SendClientMessage(playerid,0x15005EAA,\"Kérem áljon meg,vagy lövõk\");
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), \"%s Egy Rendõr által fel lett szólitva hogy áljon meg.\", giveplayer,giveplayerid);
SendClientMessageToAll(0x15005EAA, string);
} else {
SendClientMessage(playerid,0x15005EAA,\"Nincs a szerveren akit meg akarsz álitani.\");
}
return 1;
}
return 0;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= \' \'))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > \' \') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
[/pawn]