22.11.2011, 02:24
Just like they said above ^
Put it all together:
I also removed all the return 1; and added one at the bottom/end of the command. Too many returns can give you problems in-game.
Put it all together:
pawn Код:
dcmd_help(playerid,params[])
{
if(strlen(params) == 0) //if(isnull(params))
{
SendClientMessage(playerid,-1,"/help [section]");
SendClientMessage(playerid,-1,"(Sections: General - Chat - Car - Gun - Faction - Job)");
}
else if(strcmp(params,"general",true) == 0)
{
SendClientMessage(playerid,COLOR_YELLOW,"--General Commands--");
SendClientMessage(playerid, COLOR_WHITE,":: GENERAL :: /pay /charity /time /buy /unrentcar /unRentveh /switchkey /id /drink /buyclothes /doro /wo /knock /doorshout /resetspawn");
SendClientMessage(playerid, COLOR_GREY,":: GENERAL :: /resetupgrades(50k) /buygun /lock /skill /licenses /showlicenses(/sl) /report /atalk /animlist /stopanim /fuel /use");
SendClientMessage(playerid, COLOR_GREY,":: GENERAL :: (/re)port /cancel /accept /eject /usedrugs /contract /fill /admins (/f)actionlist /gps /chatmode /fightstyle /(de)attachweapon");
SendClientMessage(playerid, COLOR_WHITE,":: GENERAL :: (/wi)ndows /coin /trunk (/inv)entory /knock /knockout /give /gateopen /sid /smoke /(sur)render /cophelp /selectspawn");
SendClientMessage(playerid, COLOR_GROVE,":: GENERAL :: /cellphonehelp /househelp /notehelp /vehiclehelp /renthelp /businesshelp /leaderhelp /fishhelp /cookhelp /irchelp /derbyhelp /Bankhelp");
}
else if(strcmp(params,"chat",true) == 0)
{
SendClientMessage(playerid,COLOR_YELLOW,"--Chat Commands--");
SendClientMessage(playerid, COLOR_WHITE,":: CHAT :: (/o)oc /me /(ad)vertise (/cw)hisper (/s)hout /(w)hisper (/b) /(l)ocal (/f)action /me /do /togfam /togpm /togphone");
}
else if(strcmp(params,"car",true) == 0)
{
SendClientMessage(playerid,COLOR_YELLOW,"--Car Commands--");
SendClientMessage(playerid, COLOR_WHITE,":: CAR :: /engine /lon /loff");
}
else if(strcmp(params,"gun",true) == 0)
{
SendClientMessage(playerid,COLOR_YELLOW,"--Gun Commands--");
SendClientMessage(playerid, COLOR_GRAD3,":: Weapon :: /dgun /pgun /buygun (in ammunation)");
}
else if(strcmp(params,"faction",true) == 0)
{
SendClientMessage(playerid,COLOR_YELLOW,"--Faction Help--");
if(PlayerInfo[playerid][pLeader] == 14 || PlayerInfo[playerid][pMember] == 14)
{
SendClientMessage(playerid, COLOR_YELLOW2, ":: Triads :: (/r)adio (/jap)aneese /security");
}
if(PlayerInfo[playerid][pLeader] == 15 || PlayerInfo[playerid][pMember] == 15)
{
SendClientMessage(playerid, COLOR_YELLOW2, ":: Ballas :: (/r)adio (/rus)sian /security");
}
if(PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 5)
{
SendClientMessage(playerid, COLOR_YELLOW2, ":: Mexicans :: (/r)adio (/spa)nish /security ");
}
if(PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pMember] == 6)
{
SendClientMessage(playerid, COLOR_YELLOW2, ":: La Famiglia Vagos :: /gateopen /tuningopen (/r)adio /italian /security");
}
if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
{
SendClientMessage(playerid,COLOR_YELLOW2,":: HITMAN :: /portable /Hitmenopen");
}
if(PlayerInfo[playerid][pMember] == 11||PlayerInfo[playerid][pLeader] == 11)
{
SendClientMessage(playerid,COLOR_YELLOW2,":: LESSON :: /startlesson /stoplesson /givelicense");
}
}
else if(strcmp(params,"job",true) == 0)
{
if(PlayerInfo[playerid][pJob] == 1)
{
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Detective:: /find"); }
else if(PlayerInfo[playerid][pJob] == 2) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Lawyer :: /free"); }
else if(PlayerInfo[playerid][pJob] == 3) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Whore :: /sex"); }
else if(PlayerInfo[playerid][pJob] == 4) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Drug Dealer :: /selldrugs /get drugs"); }
else if(PlayerInfo[playerid][pJob] == 5) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Drug Dealer :: /dropcar"); }
else if(PlayerInfo[playerid][pJob] == 6) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Waiter :: /showmenu /cookuniform"); }
else if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - News Reporter :: /paper /papers /live /news [text]"); }
else if(PlayerInfo[playerid][pJob] == 7) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Mechanic :: /repair /refill /duty /tow"); }
else if(PlayerInfo[playerid][pJob] == 8) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Bodyguard :: /guard"); }
else if(PlayerInfo[playerid][pJob] == 10) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Car Dealer :: /sellcar"); }
//else if(PlayerInfo[playerid][pJob] == 11) {
//SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Stuntman :: /startstunt /stopstunt"); }
else if(PlayerInfo[playerid][pJob] == 12) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Boxer :: /fight /boxstats"); }
else if(PlayerInfo[playerid][pJob] == 13 || PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Taxi Driver :: /fare "); }
else if(PlayerInfo[playerid][pJob] == 14) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Bus Driver:: /fare"); }
else if(PlayerInfo[playerid][pJob] == 15) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Paper Boy :: /papers /bring /deliver"); }
else if(PlayerInfo[playerid][pJob] == 16) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Trucker :: /buyprods /sellprods /load"); }
else if(PlayerInfo[playerid][pJob] == 17) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Pizza Boy :: /duty /sellpizza"); }
else if(PlayerInfo[playerid][pJob] == 18) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Farmer :: /startharvest /stopharvest"); }
else if(PlayerInfo[playerid][pJob] == 19) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Illegal Farmer :: /startdrugharvest /stopdrugharvest"); }
else if(PlayerInfo[playerid][pJob] == 20) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Drugs Smuggler :: /smuggledrugs /selldrugsto"); }
else if(PlayerInfo[playerid][pJob] == 21) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Street Sweeper :: /startsweep /stopsweep"); }
else if(PlayerInfo[playerid][pJob] == 22) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Materials Smuggler :: /smugglemats /sellmats"); }
else if(PlayerInfo[playerid][pJob] == 23) {
SendClientMessage(playerid,COLOR_YELLOW2,":: JOB - Arms Dealer:: /creategun /buymats"); }
}
else
{
SendClientMessage(playerid,0xFF8000FF,"/help [section]");
SendClientMessage(playerid,0xFF8000FF,"(Sections: General - Chat - Car - Gun - Faction - Job)");
}
}
return 1;
}