#include <a_samp>//====================new Menu:jarmuvek;new Menu:autok;new Menu:motorok;new Menu:egyebek;//====================#define COLOR_NARANCS 0xFF9900AA//====================public OnFilterScriptInit(){ jarmuvek = CreateMenu(\"Jarmuvek\", 1,20,120,150,40); AddMenuItem(jarmuvek, 0, \"Autok\"); AddMenuItem(jarmuvek, 0, \"Motorok\"); AddMenuItem(jarmuvek, 0, \"Egyeb\"); autok = CreateMenu(\"Autok\", 1,20,120,150,40); AddMenuItem(autok, 0, \"Infernus ~g~$1500\"); AddMenuItem(autok, 0, \"Turismo ~g~$1500\"); AddMenuItem(autok, 0, \"Club ~g~$1000\"); AddMenuItem(autok, 0, \"Premier ~g~$1000\"); AddMenuItem(autok, 0, \"Sultan ~g~$1000\"); AddMenuItem(autok, 0, \"Stretch ~g~$1000\"); AddMenuItem(autok, 0, \"Monster ~g~$1000\"); AddMenuItem(autok, 0, \"Elegy ~g~$1000\"); AddMenuItem(autok, 0, \" Sandking~g~$1000\"); AddMenuItem(autok, 0, \"V~r~issza\"); motorok = CreateMenu(\"Motorok\", 1,20,120,150,40); AddMenuItem(motorok, 0, \"Faggio ~g~$500\"); AddMenuItem(motorok, 0, \"PCJ-600 ~g~$700\"); AddMenuItem(motorok, 0, \"FCR-900 ~g~$900\"); AddMenuItem(motorok, 0, \"NRG-500 ~g~$1000\"); AddMenuItem(motorok, 0, \"BF-400 ~g~$900\"); AddMenuItem(motorok, 0, \"Wayfarer ~g~$1000\"); AddMenuItem(motorok, 0, \"Sanchez ~g~$1000\"); AddMenuItem(motorok, 0, \"V~r~issza\"); egyebek = CreateMenu(\"Egyebek\", 1,20,120,150,40); AddMenuItem(egyebek, 0, \"Stunt ~g~$1500\"); AddMenuItem(egyebek, 0, \"Squallo ~g~$1200\"); AddMenuItem(egyebek, 0, \"Maverick ~g~$1500\"); AddMenuItem(egyebek, 0, \"BMX ~g~$1500\"); AddMenuItem(egyebek, 0, \"Bike ~g~$1200\"); AddMenuItem(egyebek, 0, \"Mountain bike ~g~$1500\"); AddMenuItem(egyebek, 0, \"V~r~issza\"); return 1;}//====================public OnPlayerCommandText(playerid, cmdtext[]){ if (strcmp(\"/jarmuvek\", cmdtext, true, 10) == 0) { ShowMenuForPlayer(jarmuvek,playerid); TogglePlayerControllable(playerid,false); return 1; } return 0;}//====================public OnPlayerSelectedMenuRow(playerid, row){ new Menu:CurrentMenu = GetPlayerMenu(playerid); if(CurrentMenu == jarmuvek) { switch(row) { case 0: { ShowMenuForPlayer(autok, playerid); } case 1: { ShowMenuForPlayer(motorok, playerid); } case 2: { ShowMenuForPlayer(egyebek, playerid); } } } if(CurrentMenu == autok) { switch(row) { case 0: { new Float:X,Float:Y,Float:Z;GetPlayerPos(playerid, X,Y,Z);CreateVehicle(411, X,Y,Z, 0.0, 100, 100, 60000);HideMenuForPlayer(jarmuvek, playerid);TogglePlayerControllable(playerid, true);GivePlayerMoney(playerid, -1500);new name[256];new string[256];GetPlayerName(playerid, name, sizeof(name));format(string, sizeof(string), \"[iNFÓ] %s szerzett magának egy Infernus-t $1500-ért.\", name);SendClientMessageToAll(COLOR_NARANCS, string);TogglePlayerControllable(playerid,1); } case 1: { new Float:X,Float:Y,Float:Z;GetPlayerPos(playerid, X,Y,Z);CreateVehicle(451, X,Y,Z, 0.0, 100, 100, 60000);HideMenuForPlayer(jarmuvek, playerid);TogglePlayerControllable(playerid, true);GivePlayerMoney(playerid, -1500);new name[256];new string[256];GetPlayerName(playerid, name, sizeof(name));format(string, sizeof(string), \"[iNFÓ] %s szerzett magának egy Turismo-t $1500-ért.\", name);SendClientMessageToAll(COLOR_NARANCS, string);TogglePlayerControllable(playerid,1); } case 2: { new Float:X,Float:Y,Float:Z;GetPlayerPos(playerid, X,Y,Z);CreateVehicle(589, X,Y,Z, 0.0, 100, 100, 60000);HideMenuForPlayer(jarmuvek, playerid);TogglePlayerControllable(playerid, true);GivePlayerMoney(playerid, -1000);new name[256];new string[256];GetPlayerName(playerid, name, sizeof(name));format(string, sizeof(string), \"[iNFÓ] %s szerzett magának egy Club-ot $1000-ért.\", name);SendClientMessageToAll(COLOR_NARANCS, string);TogglePlayerControllable(playerid,1); } case 3: { new Float:X,Float:Y,Float:Z;GetPlayerPos(playerid, X,Y,Z);CreateVehicle(426, X,Y,Z, 0.0, 100, 100, 60000);HideMenuForPlayer(jarmuvek, playerid);TogglePlayerControllable(playerid, true);GivePlayerMoney(playerid, -1000);new name[256];new string[256];GetPlayerName(playerid, name, sizeof(name));format(string, sizeof(string), \"[iNFÓ] %s szerzett magának egy Premier-t $1000-ért.\", name);SendClientMessageToAll(COLOR_NARANCS, string);TogglePlayerControllable(playerid,1); }
new PlayerVeh[MAX_PLAYERS];
PlayerVeh[playerid] = CreateVehicle(...)
DestroyVehicle(PlayerVeh[playerid]);
{ new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z); CreateVehicle(411, X,Y,Z, 0.0, 100, 100, 60000); HideMenuForPlayer(jarmuvek, playerid); TogglePlayerControllable(playerid, true); GivePlayerMoney(playerid, -1500); new name[256]; new string[256]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), \"[iNFÓ] %s szerzett magának egy Infernus-t $1500-ért.\", name); SendClientMessageToAll(COLOR_NARANCS, string); TogglePlayerControllable(playerid,1); }
{ new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z); DestroyVehicle(PlayerVeh[playerid]); PlayerVeh[playerid] = CreateVehicle(411, X,Y,Z, 0.0, 100, 100, 60000); HideMenuForPlayer(jarmuvek, playerid); TogglePlayerControllable(playerid, true); GivePlayerMoney(playerid, -1500); new name[256]; new string[256]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), \"[iNFÓ] %s szerzett magának egy Infernus-t $1500-ért.\", name); SendClientMessageToAll(COLOR_NARANCS, string); TogglePlayerControllable(playerid,1); }[/quote]És a végére egy ajánlatNe minden lépésben kérd le a Player nevét, és pozítiójár, mert kicsit terheli a szervert..Tedd ezt new Float:X, Float:Y, Float:Z, name[MAX_PALYER_NAME], string[256];GetPlayerPos(playerid, X, Y, Z);GetPlayerName(playerid, name, sizeof(name)); az OnPlayerSelectMenuRow alá, és töröld mindenhonnan a new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);new name[256]; new string[256]; GetPlayerName(playerid, name, sizeof(name)); sorokat.
new Float:X, Float:Y, Float:Z, name[MAX_PALYER_NAME], string[256];GetPlayerPos(playerid, X, Y, Z);GetPlayerName(playerid, name, sizeof(name));
new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);new name[256]; new string[256]; GetPlayerName(playerid, name, sizeof(name));
public OnPlayerSelectedMenuRow(playerid, row)