tessék
[pawn]if(strcmp(cmd, \"/hitman\", true) == 0) {
switch (Nyelv[playerid])
{
case 0: //Ez itt a 0-ás azaz a magyar
{
//new tmp[100];
tmp = strtok(cmdtext, idx);
//new id;
new amm;
if(!strlen(tmp)) {
SendClientMessage(playerid, ADMIN_RED, \"Használat: /hitman [playerid/név] [összeg]\");
}
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, ADMIN_RED, \"Hiba: Nincs ilyen játékos!\");
else if (amm < 1) SendClientMessage(playerid, ADMIN_RED, \"Hiba: Rossz összeg!\");
else if (GetPlayerMoney(playerid) < amm) SendClientMessage(playerid, ADMIN_RED, \"Hiba: Nincs rá elég pénzed!\");
else{
Info[id][hit] += amm;
new namep[MAX_PLAYER_NAME], namep2[MAX_PLAYER_NAME];
GetPlayerName(playerid, namep, sizeof (namep));
GetPlayerName(id, namep2, sizeof (namep2));
format(string, sizeof string, \"%s vérdíjat tûzött ki %s fejére! Aki megöli %s-t $%d jutalomban részesül!\", namep, namep2, namep2, Info[id][hit]);
SendClientMessageToAll(COLOR_ORANGE, string);
}
}
case 1: //Ez itt az 1-es azaz angol
{
//new tmp[100];
tmp = strtok(cmdtext, idx);
//new id;
new amm;
if(!strlen(tmp)) {
SendClientMessage(playerid, ADMIN_RED, \"Usage: /hitman [playerid / name] [amount]\");
}
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, ADMIN_RED, \"Error: No such player!\");
else if (amm < 1) SendClientMessage(playerid, ADMIN_RED, \"Error: Invalid amount!\");
else if (GetPlayerMoney(playerid) < amm) SendClientMessage(playerid, ADMIN_RED, \"Error: Not enough money on it!\");
else{
Info[id][hit] += amm;
new namep[MAX_PLAYER_NAME], namep2[MAX_PLAYER_NAME];
GetPlayerName(playerid, namep, sizeof (namep));
GetPlayerName(id, namep2, sizeof (namep2));
format(string, sizeof string, \"%s set a bounty on %s head! Anyone who kills for %s $%d rewarded!\", namep, namep2, namep2, Info[id][hit]);
SendClientMessageToAll(COLOR_ORANGE, string);
}
}
return 1;
}[/pawn]
Nekem semmi hiba =))
[pawn]#include <a_samp>
#if defined FILTERSCRIPT
new Nyelv[MAX_PLAYERS] = 0; //Itt csinálunk egy változott a nyelvhez
public OnFilterScriptInit()
{
return 1;
}
public OnFilterScriptExit()
{
print(\"\\n----------------------------------\");
print(\" Nyelvválasztó by Ty$oN (Kikapcsolás)\");
print(\"----------------------------------\\n\");
return 1;
}
public OnPlayerConnect(playerid)
{
//Itt 2 nyelv lesz csak! (Magyar+Angol)
ShowPlayerDialog(playerid, 555, DIALOG_STYLE_LIST, \"Nyelv/Language\",\"Magyar\\nAngol\",\"Kiválasztás\",\"\");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, \"/hitman\", true) == 0) {
switch (Nyelv[playerid])
{
case 0: //Ez itt a 0-ás azaz a magyar
{
//new tmp[100];
tmp = strtok(cmdtext, idx);
//new id;
new amm;
if(!strlen(tmp)) {
SendClientMessage(playerid, ADMIN_RED, \"Használat: /hitman [playerid/név] [összeg]\");
}
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, ADMIN_RED, \"Hiba: Nincs ilyen játékos!\");
else if (amm < 1) SendClientMessage(playerid, ADMIN_RED, \"Hiba: Rossz összeg!\");
else if (GetPlayerMoney(playerid) < amm) SendClientMessage(playerid, ADMIN_RED, \"Hiba: Nincs rá elég pénzed!\");
else{
Info[id][hit] += amm;
new namep[MAX_PLAYER_NAME], namep2[MAX_PLAYER_NAME];
GetPlayerName(playerid, namep, sizeof (namep));
GetPlayerName(id, namep2, sizeof (namep2));
format(string, sizeof string, \"%s vérdíjat tûzött ki %s fejére! Aki megöli %s-t $%d jutalomban részesül!\", namep, namep2, namep2, Info[id][hit]);
SendClientMessageToAll(COLOR_ORANGE, string);
}
}
case 1: //Ez itt az 1-es azaz angol
{
//new tmp[100];
tmp = strtok(cmdtext, idx);
//new id;
new amm;
if(!strlen(tmp)) {
SendClientMessage(playerid, ADMIN_RED, \"Usage: /hitman [playerid / name] [amount]\");
}
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, ADMIN_RED, \"Error: No such player!\");
else if (amm < 1) SendClientMessage(playerid, ADMIN_RED, \"Error: Invalid amount!\");
else if (GetPlayerMoney(playerid) < amm) SendClientMessage(playerid, ADMIN_RED, \"Error: Not enough money on it!\");
else{
Info[id][hit] += amm;
new namep[MAX_PLAYER_NAME], namep2[MAX_PLAYER_NAME];
GetPlayerName(playerid, namep, sizeof (namep));
GetPlayerName(id, namep2, sizeof (namep2));
format(string, sizeof string, \"%s set a bounty on %s head! Anyone who kills for %s $%d rewarded!\", namep, namep2, namep2, Info[id][hit]);
SendClientMessageToAll(COLOR_ORANGE, string);
}
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 555)
{
if(response)
{
if(listitem == 0)
{
Nyelv[playerid] = 0; // Itt kiválasztottuk az magyar nyelvet!
SendClientMessage(playerid,0xC0C0C0FF,\"A nyelvedet magyarra állitottad.\");
}
if(listitem == 1)
{
Nyelv[playerid] = 1; // Itt kiválasztottuk az angol nyelvet!
SendClientMessage(playerid,0xC0C0C0FF,\"You choose the english language.\");
}
}
return 1;
}
#endif[/pawn]