29.10.2015, 21:08
Hey guys, so I have got a menu, which will choose each category, like "/help account" or /help vehicle. and so on.
this is the full code:
But it keeps to repeat the same three last lines -
when I choose an option, it shows these lines again and again.
how do I do only when I type /help or /help without a category name such as /help misc
it will show these there lines above ^
tried few ways, still the same.
this is the full code:
PHP код:
CMD:help(playerid, params[])
{
if (!strcmp(params, "general", true))
{
SendClientMessage(playerid, COLOR_NICEYELLOW, ". : : General commands : : .");
SendClientMessage(playerid, COLOR_NICEBLUE, "/stats, /report, /helpme, /acc, /me, /do, /(s)hout, /(o)oc, /inventory, /switch.");
SendClientMessage(playerid, COLOR_NICELBLUE, "/approve, /faq, /sell, /paint, /drink, /bank, /cook, /vest, /ammo, /usekit, /phone.");
SendClientMessage(playerid, COLOR_NICEBLUE, "/id, /call, /hangup, /text, /drop, /flist, /crates, /fill, /pay, /gps, /open, /usedrug.");
SendClientMessage(playerid, COLOR_NICELBLUE, "/animcmds, /backpack, /boombox, /channel, /jobcmds, /supporters, /disablecp, /stopanim.");
SendClientMessage(playerid, COLOR_NICEBLUE, "/shakehand, /showlicense, /frisk, /toghud, /passwep, /setradio, /picklock, /resetvw. /factionhelp.");
}
if (!strcmp(params, "account", true))
{
SendClientMessage(playerid, COLOR_NICEYELLOW, ". : : Account Commands : : .");
SendClientMessage(playerid, COLOR_NICEBLUE, "/changepass, /lastlogged, /username, /properties.");
}
if (!strcmp(params, "vehicle", true))
{
SendClientMessage(playerid, COLOR_NICEYELLOW, ". : : Vehicle Commands : : .");
SendClientMessage(playerid, COLOR_NICEBLUE, "/park, /lock, /abandon, /refuel, /unmod, /trunk, /listcars, /engine, /lights, /hood, /tow.");
}
if (!strcmp(params, "business", true))
{
SendClientMessage(playerid, COLOR_NICEYELLOW, ". : : Business Commands : : .");
SendClientMessage(playerid, COLOR_NICEBLUE, "/buy, /abandon, /lock, /vault, /products, /binfo, /bname, /bmessage, /bshipment.");
}
if (!strcmp(params, "house", true))
{
SendClientMessage(playerid, COLOR_NICEYELLOW, ". : : House Commands : : .");
SendClientMessage(playerid, COLOR_NICEBLUE, "/buy, /abandon, /lock, /storage, /furniture, /buyrack, /gunrack, /deleterack.");
SendClientMessage(playerid, COLOR_NICEBLUE, "/doorbell, /switch.");
}
if (!strcmp(params, "property", true))
{
SendClientMessage(playerid, COLOR_NICEYELLOW, ". : : Property Commands : : .");
SendClientMessage(playerid, COLOR_NICEBLUE, "/buy, /abandon, /lock, /housecmds, /products, /vault, /binfo, /bizcmds.");
}
if (!strcmp(params, "Helper", true))
{
if (!PlayerData[playerid][pTester]) { return SendClientMessage(playerid, COLOR_NICEBLUE, "SERVER: You cannot use this command");
}
SendClientMessage(playerid, COLOR_NICEYELLOW, ". : : Helper Commands : : .");
SendClientMessage(playerid, COLOR_NICEBLUE, "/t, /tduty, /ah, /dh, /kick");
}
else if (!strcmp(params, "admin", true))
{
if (!PlayerData[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_NICEBLUE, "SERVER: You cannot use this command");
}
SendClientMessage(playerid, COLOR_NICEYELLOW, ". : : Administrator Commands : : .");
if (PlayerData[playerid][pAdmin] >= 1) {
SendClientMessage(playerid, COLOR_NICEBLUE, "/a, /reports, /spectate, /ajail, /release, /kick, /mute, /unmute, /freeze, /unfreeze.");
SendClientMessage(playerid, COLOR_NICELBLUE, "/aduty, /ban, /skin /goto /aremovecall");
}
if (PlayerData[playerid][pAdmin] >= 2) {
SendClientMessage(playerid, COLOR_NICEBLUE, "/respawn, /warn, /checkstats, /shooter, /goto, /bring, /setinterior, /setvw.");
SendClientMessage(playerid, COLOR_NICELBLUE, "/sendto, /clearchat, /spawn, /refill, /revive, /aslap, /acceptname, /declinename, /atalk.");
SendClientMessage(playerid, COLOR_NICEBLUE, "/masked, /listguns, /respawncar, /respawncars, /respawnnear, /heal, /bringcar, /gotocar.");
SendClientMessage(playerid, COLOR_NICELBLUE, "/x /y /z");
}
if (PlayerData[playerid][pAdmin] >= 3) {
SendClientMessage(playerid, COLOR_NICEBLUE, "/unban, /blacklist, /getip, /togooc, /health, /armor, /resetweps, /arepair, /listwarns.");
SendClientMessage(playerid, COLOR_NICELBLUE, "/entercar, /flipcar, /veh, /destroyveh, /near, /healall, /tracenumber, /bleeding.");
SendClientMessage(playerid, COLOR_NICEBLUE, "/atune, /acolorcar, /apaintjob, /afire, /akillfire, /adestroybox.");
}
if (PlayerData[playerid][pAdmin] >= 4) {
SendClientMessage(playerid, COLOR_NICEBLUE, "/givewep, /settester, /baninfo, /setname, /asetfaction, /asetrank, /setitem.");
SendClientMessage(playerid, COLOR_NICELBLUE, "/asellhouse, /asellbiz, /jetpack, /setweather, /setfuel, /setcarhp, /spawnitem.");
SendClientMessage(playerid, COLOR_NICEBLUE, "/setquantity, /destroyitem, /setplayer, /setleader, /setinventory, /givecar.");
}
if (PlayerData[playerid][pAdmin] >= 5) {
SendClientMessage(playerid, COLOR_NICELBLUE, "/dynamichelp, /givecash, /clearinventory, /clearwarns, /saveall, /restart.");
}
if (PlayerData[playerid][pAdmin] >= 6) {
SendClientMessage(playerid, COLOR_NICEBLUE, "/makeadmin, /deleteaccount, /deletechar, /factionmod, /panel.");
}
}
else
{
SendClientMessage(playerid, COLOR_NICEYELLOW, ". : : Help List : : .");
SendClientMessage(playerid, COLOR_NICEBLUE, "TIP: /help [name]");
SendClientMessage(playerid, COLOR_NICEBLUE, "Names: General, Account, Vehicle, Business, House , Property, Helper, Admin");
}
return 1;
}
PHP код:
SendClientMessage(playerid, COLOR_NICEYELLOW, ". : : Help List : : .");
SendClientMessage(playerid, COLOR_NICEBLUE, "TIP: /help [name]");
SendClientMessage(playerid, COLOR_NICEBLUE, "Names: General, Account, Vehicle, Business, House ,
how do I do only when I type /help or /help without a category name such as /help misc
it will show these there lines above ^
tried few ways, still the same.