public OnPlayerCommandText(playerid, cmdtext[])
{
new name[MAX_PLAYER_NAME], string[256], i;
format(string, sizeof(string), \"%s parancsot használt! %s\", name, cmdtext);
for(i++; i < MAX_PLAYERS;)
{
if(IsPlayerConnected(i))
{
if(IsPlayerAdmin(i))
{
SendClientMessage(i, 0xDCDCDCAA, string);
}
}
}
dcmd(tele,4,cmdtext);
dcmd(saveallstats,12,cmdtext);
dcmd(rape,4,cmdtext);
dcmd(car,3,cmdtext);
dcmd(gps,3,cmdtext);
dcmd(work,4,cmdtext);
dcmd(acmds,5,cmdtext);
dcmd(rob,3,cmdtext);
dcmd(settime,7,cmdtext);
dcmd(setweather,10,cmdtext);
dcmd(kick,4,cmdtext);
dcmd(fix,3,cmdtext);
dcmd(ban,3,cmdtext);
dcmd(givemoney,9,cmdtext);
dcmd(setmoney,8,cmdtext);
dcmd(jail,4,cmdtext);
dcmd(unjail,6,cmdtext);
dcmd(freeze,6,cmdtext);
dcmd(unfreeze,8,cmdtext);
dcmd(sethealth,9,cmdtext);
dcmd(setarmour,9,cmdtext);
dcmd(setname,7,cmdtext);
dcmd(admins,6,cmdtext);
dcmd(cmds,4,cmdtext);
dcmd(akill,5,cmdtext);
dcmd(setplayercompletedmissions,26,cmdtext);
dcmd(cancelpmission,14,cmdtext);
dcmd(resetplayermissions,19,cmdtext);
dcmd(me,2,cmdtext);
dcmd(ip,2,cmdtext);
dcmd(stats,5,cmdtext);
dcmd(goto,4,cmdtext);
dcmd(announce,8,cmdtext);
dcmd(slap,4,cmdtext);
dcmd(heal,4,cmdtext);
dcmd(healall,7,cmdtext);
dcmd(armourall,9,cmdtext);
dcmd(giveallmoney,12,cmdtext);
dcmd(get,3,cmdtext);
dcmd(unban,5,cmdtext);
dcmd(setlevel,8,cmdtext);
dcmd(fare,4,cmdtext);
dcmd(phelp,5,cmdtext);
dcmd(help,4,cmdtext);
dcmd(rules,5,cmdtext);
dcmd(credits,7,cmdtext);
dcmd(suspects,8,cmdtext);
dcmd(taxi,4,cmdtext);
dcmd(cancelorder,11,cmdtext);
dcmd(ticket,6,cmdtext);
dcmd(pay,3,cmdtext);
dcmd(arrest,6,cmdtext);
dcmd(createbank,10,cmdtext);
dcmd(createshop,10,cmdtext);
if (strcmp(cmdtext,\"/detach\",true) == 0)
{
if(!IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid,red,\"HIBA: \"lgrey\"Nincs egy \"lyellow2\"potkocsi\"lgrey\" csatolva a kamionhoz!\");
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid,green,\"» Pot lecsatolva!\");
return 1;
}
if (strcmp(cmdtext,\"/munkavaltas\",true) == 0)
{
SetPlayerHealth(playerid,0.0);
ForceClassSelection(playerid);
SendClientMessage(playerid,green,\"Munkát váltottál!\");
return 1;
}
if(strcmp(cmdtext,\"/fuelcar\",true) == 0)
{
new Float:x,Float:y,Float:z,engine,lights,alarm,doors,bonnet,boot,objective;
if(gTeam[playerid] != TEAM_ASSISTANCE) return SendClientMessage(playerid,red,\"HIBA: \"lgrey\"Te nem vagy \"lyellow2\"autómentõ\"lgrey\" hogy használd ezt a parancsot!\");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,\"HIBA: \"lgrey\"Kérlek szálj ki az autóból!\");
for(new i = 0;i < MAX_VEHICLES;i++)
{
GetVehiclePos(i,x,y,z);
if(!IsPlayerInRangeOfPoint(playerid,10.0,x,y,z)) continue;
if(!VehicleOccupied(i)) return SendClientMessage(playerid,red,\"HIBA: \"lgrey\"Nincs a közelbe egy soför se autoval\");
GivePlayerMoney(GetVehicleDriver(i),-5000);
GivePlayerMoney(playerid,5000);
SendClientMessage(GetVehicleDriver(i),green,\"» Fizetél $5,000 az autómentõ szolgálatnak !\");
SendClientMessage(playerid,green,\"» Kaptál $5,000 a segítségért!\");
fuel = 100;
TextDrawSetString(fueltd[GetVehicleDriver(i)],\"~b~~h~Benzin: ~g~~h~IIIIIIIIII\");
TextDrawShowForPlayer(GetVehicleDriver(i),fueltd[GetVehicleDriver(i)]);
GetVehicleParamsEx(GetPlayerVehicleID(GetVehicleDriver(i)),engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(GetPlayerVehicleID(GetVehicleDriver(i)),1,lights,alarm,doors,bonnet,boot,objective);
PlaySound(playerid,1133);
PlaySound(GetVehicleDriver(i),1133);
return 1;
}
SendClientMessage(playerid,red,\"HIBA: \"lgrey\"Nincs autó a közeledben!\");
return 1;
}
if(strcmp(cmdtext,\"/fixcar\",true) == 0)
{
new Float:x,Float:y,Float:z;
if(gTeam[playerid] != TEAM_ASSISTANCE) return SendClientMessage(playerid,red,\"HIBA: \"lgrey\"Nem vagy \"lyellow2\"autómentõ\"lgrey\" hogy használd a parancsot!\");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,\"HIBA: \"lgrey\"Kérlek szály ki az autóból!\");
for(new i = 0;i < MAX_VEHICLES;i++)
{
GetVehiclePos(i,x,y,z);
if(!IsPlayerInRangeOfPoint(playerid,10.0,x,y,z)) continue;
if(!VehicleOccupied(i)) return SendClientMessage(playerid,red,\"HIBA: \"lgrey\"Nincs a közeledben vezetõ!\");
GivePlayerMoney(GetVehicleDriver(i),-35000);
GivePlayerMoney(playerid,35000);
SendClientMessage(GetVehicleDriver(i),green,\"» Fizetél $35,000 az autómentõ szolgálatnak!\");
SendClientMessage(playerid,green,\"» Kaptál $35,000 a segitségért!\");
RepairVehicle(i);
PlaySound(playerid,1133);
PlaySound(GetVehicleDriver(i),1133);
return 1;
}
SendClientMessage(playerid,red,\"HIBA: \"lgrey\"Nincs a közeledbe autó!\");
return 1;
}
if(strcmp(cmdtext,\"/trucks\",true) == 0)
{
ShowPlayerDialog(playerid,5624,0,\"Kamionok és potkocsik\",\"Road Train - 515 \\nTanker - 514 \\nLine Runner - 403 \\n\\n\\tTrailers\\n\\nArticle Trailer 1 - 435 \\nArticle Trailer 2 - 450 \\nArticle Trailer 3 - 591 \\nPetrol Tanker Trailer - 584\",\"Ok\",\"\");
return 1;
}
if(strcmp(cmdtext,\"/rescueme\",true) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,\"Autóba kell lened!\");
if(!IsTeamOnline(TEAM_ASSISTANCE))
{
ShowPlayerDialog(playerid,rescuedialog,2,\"\"lyellow\"Lista\",\"\"lyellow2\"Tankolás \\n\"lblue\"Jármû felálitás\",\">>\",\"Close\");
}
else
{
SendClientMessage(playerid,red,\"» Nincs autószerelõ \"lyellow2\"(/phone)\");
}
return 1;
}
if(!strcmp(\"/stopwork\", cmdtext, true))
{
if (IsPlayerInMission[playerid] == 0) return SendClientMessage(playerid, red, \"HIBA: \"lgrey\"Nem \"lyellow2\"dolgozol\"lgrey\"! Írd be \"lyellow2\"/work\"lgrey\" hogy dolgoz!\");
IsPlayerInMission[playerid] = 0;
CancelPlayersCurrentMission(playerid);
return 1;
}
if(!strcmp(\"/inventory\",cmdtext,true))
{
ShowPlayerDialog(playerid,invdialog,2,\"Leltár\",\"Üzemenyag kana \\nTelefon \\nUse Gps\",\"Ok\",\"Kilépés\");
return 1;
}
if(!strcmp(\"/answer\",cmdtext,true))
{
new string[100];
if(PInfo[playerid][called] == -1) return SendClientMessage(playerid,red,\"Nincs hívás a fogadáshoz!\");
SendClientMessage(playerid,red,\"/endcall az aktuális hívás befejezéséhez!\");
format(string,sizeof(string),\"\"lyellow2\"%s\"lgreen\" már válaszolt!\",GetPName(playerid));
SendClientMessage(PInfo[playerid][called],red,string);
PInfo[PInfo[playerid][called]][answerd] = 1;
PInfo[playerid][answerd] = 1;
return 1;
}
if(!strcmp(\"/endcall\",cmdtext,true))
{
new string[100];
if(PInfo[playerid][called] == -1) return SendClientMessage(playerid,red,\"Nincs hívás hogy befejezd!\");
SendClientMessage(playerid,red,\"Hívás befejezve!\");
format(string,sizeof(string),\"\"lyellow2\"%s\"lgreen\" befejezte a hívást!\",GetPName(playerid));
SendClientMessage(PInfo[playerid][called],red,string);
PInfo[PInfo[playerid][called]][answerd] = -1;
PInfo[PInfo[playerid][called]][called] = -1;
PInfo[playerid][called] = -1;
PInfo[playerid][answerd] = -1;
return 1;
}
if(!strcmp(\"/easyy\",cmdtext,true))
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(strcmp(PlayerName,\"EasY\",true))
{
SendClientMessage(playerid,red,\"» Sajnálom! Csak EasY teleportálhat ide!\");
}
else
{
SetPlayerPos(playerid,1045.3973,1355.3148,11.4274);
}
}
if(strcmp(cmdtext,\"/cleanupcars\", true)== 0)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(PInfo[playerid][Level] < 3)
{
SendClientMessage(playerid,red,\"» Sajnálom! Nem kértél engedélyt hogy carresi-zz!\");
}
else
{
GameTextForAll(\"~w~Hamarosan carresi!\",2000,1);
SetTimer(\"Go20\", 1000, 0);
SetTimer(\"Go19\", 2000, 0);
SetTimer(\"Go18\", 3000, 0);
SetTimer(\"Go17\", 4000, 0);
SetTimer(\"Go16\", 5000, 0);
SetTimer(\"Go15\", 6000, 0);
SetTimer(\"Go14\", 7000, 0);
SetTimer(\"Go13\", 8000, 0);
SetTimer(\"Go12\", 9000, 0);
SetTimer(\"Go11\", 10000, 0);
SetTimer(\"Go10\", 11000, 0);
SetTimer(\"Go9\", 12000, 0);
SetTimer(\"Go8\", 13000, 0);
SetTimer(\"Go7\", 14000, 0);
SetTimer(\"Go6\", 15000, 0);
SetTimer(\"Go5\", 16000, 0);
SetTimer(\"Go4\", 17000, 0);
SetTimer(\"Go3\", 18000, 0);
SetTimer(\"Go2\", 19000, 0);
SetTimer(\"Go1\", 20000, 0);
SetTimer(\"VehicleReset\", 21000,0);
SetTimer(\"CarresetMessage\", 21100,0);
SendClientMessage(playerid, blue,\"» Carresi Elindítva\");
}
}
if(strcmp(cmdtext,\"/sos\",true) == 0)
{
new string[200];
if(PInfo[playerid][beenrescued] == 1) return SendClientMessage(playerid,red,\"Te nemrég voltál megmentve, kel várjár mielöt kérsz segitséget ismét!\");
if(PInfo[playerid][rescue] == 1) return SendClientMessage(playerid,red,\"You have recently requested a SOS rescue!\");
PInfo[playerid][rescue] = 1;
PInfo[playerid][beenrescued] = 0;
format(string,sizeof(string),\"»» %s(ID:%d) baj van!(menj a piros jelhez)\",GetPName(playerid),playerid);
SendAssistanceMessage(orange,string);
SendAssistanceMessage(lightblue,\"Autószerelõ parancsok: /fuelcar /fixcar\");
for(new i = 0;i < MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(gTeam == TEAM_ASSISTANCE)
{
SetPlayerMarkerForPlayer(i,playerid,red);
}
}
}
SendClientMessage(playerid,red,\"» Hívtad az autószerelõket, várj a még megérkeznek!\");
CanUseRescue[playerid] = SetTimerEx(\"Canuserescue\",20000,true,\"i\",playerid);
return 1;
}
if(strcmp(cmdtext,\"/phone\",true) == 0)
{
if(PInfo[playerid][hasphone] == 0) return SendClientMessage(playerid,red,\"\"lred\"Nincs \"lgreen\"telefonod! \"lred\"Menj egy \"lyellow2\"kamionos üzletbe \"lgrey\"hogy vegyél egyet.\") && SendClientMessage(playerid,red,\"Ha autómentõt akarsz hivni akkor írd be \"lyellow2\"/sos\");
ShowPlayerDialog(playerid,Choosecalldialog,2,\"Szeretnél hívni valakit?\",\"Barát hívása \\nAutószerelõ hívása \\nTaxi hívása\",\"Hívás\",\"Kilépés\");
return 1;
}
return 0;
}
Ez legyen a OnPlayerCommandText callback tartalma.. Nem igaz hogy a szar megoldásokkal tömitek a kezdõket.. Inkább nem is mondok semmit..