SA-MP Forums Archive
Crazy Commands - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Crazy Commands (/showthread.php?tid=90287)



Crazy Commands - Geekzor - 07.08.2009

Hello Guys I Dont Know What is Wrong with this command ...

here is the code:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(!strcmp(cmdtext, "/help", true))
  {
  if(gTeam[playerid] == TEAM_TAXIDRIVER)
  {
  	SendClientMessage(playerid,0x33AA33AA,"Your Job Is A Taxi Driver!");
  	SendClientMessage(playerid,0x33AA33AA,"You Can Do Your Job Just When You Are In Taxi Or Bus!");
  	SendClientMessage(playerid,0x33AA33AA,"When You Enter Taxi Or Bus Type /onduty So Players Will Know That You Are On Duty As Taxi/Bus Driver");
  	SendClientMessage(playerid,0x33AA33AA,"They Will Tell You Where They Want To Go (Location)");
  	SendClientMessage(playerid,0x33AA33AA,"You Can See Players Who Need A Driver On Map! They Will Be Marked!");
  	SendClientMessage(playerid,0x33AA33AA,"For More Infromation About This Game/Server/Jobs You Can Contact Admin with Command /helpme (msg)");
	}
	return true;
	}
	if(gTeam[playerid] == TEAM_FOODDELIVERY)
	{
	SendClientMessage(playerid,0xFFFF00AA,"Your Job Is A Food Delivery!");
	SendClientMessage(playerid,0xFFFF00AA,"You Can Do Your Job On Foot,Trucks,Motorbikes... Doesnt Matter in What Vehicle You Are!");
	SendClientMessage(playerid,0xFFFF00AA,"You Must Type /Foodsell To Sell Food To Player Who Call You");
	SendClientMessage(playerid,0xFFFF00AA,"Players Who Need Food Will Be Marked On Map!");
	SendClientMessage(playerid,0xFFFF00AA,"For More Infromation About This Game/Server/Jobs You Can Contact Admin with Command /helpme (msg)");
	return true;
	}
	return false;
}
i just make /help command for both teams but if i am in TEAM_TAXIDRIVER and i type /help it show command normal it write all with green etc so THATS OK!

but when i chose my FOODDELIVERY CLASES and type /help it wont show the messages with yellow color ...
and when i type /foodsell or /food or idk what it show me the command lol and as i know i dont have no1 command like /food or /foodsell ...

so i hope u understand my problem ...

i just wanna know what is wrong with command when i am in TEAM_DELIVERY ...

ty for any help

Kljukec


Re: Crazy Commands - Djiango - 07.08.2009

You're closing the "help command" before it even gets to the "if(gTeam[playerid] == TEAM_FOODDELIVERY)" part.


Re: Crazy Commands - Geekzor - 07.08.2009

so can u make example what i must fix ? lol


Re: Crazy Commands - Donny_k - 07.08.2009

pawn Код:
if(!strcmp(cmdtext, "/help", true))
  { //open 1
  if(gTeam[playerid] == TEAM_TAXIDRIVER)
  { //open 2
    SendClientMessage(playerid,0x33AA33AA,"Your Job Is A Taxi Driver!");
    SendClientMessage(playerid,0x33AA33AA,"You Can Do Your Job Just When You Are In Taxi Or Bus!");
    SendClientMessage(playerid,0x33AA33AA,"When You Enter Taxi Or Bus Type /onduty So Players Will Know That You Are On Duty As Taxi/Bus Driver");
    SendClientMessage(playerid,0x33AA33AA,"They Will Tell You Where They Want To Go (Location)");
    SendClientMessage(playerid,0x33AA33AA,"You Can See Players Who Need A Driver On Map! They Will Be Marked!");
    SendClientMessage(playerid,0x33AA33AA,"For More Infromation About This Game/Server/Jobs You Can Contact Admin with Command /helpme (msg)");
    } //close 2
    return true; //exit the command << this is where it exits the "/help" scope
    } //close 1
I won't fix it for you, just read the comments and think about what is happening (the guy above pointed it out).


Re: Crazy Commands - Geekzor - 07.08.2009

lol ty for help but the problem is now : when i am in taxi driver team iit says the command OK! but it say + SERVER: Unknown Command

so it show both the messages ''bla bla bla'' under this it say SERVER:Unknown Command

and when i am in food delivery team it show command normal but it show the command it doesnt matter what i type if i type /lol it will show messages if i type /iamnoobatscripting it wil lshow the mesages etc...

any help ?

i will respond leter cuz now i go outside a little at this time i hope u will help me again

ty


Re: Crazy Commands - Chrham_2 - 07.08.2009

Quote:
Originally Posted by Geekzor
lol ty for help but the problem is now : when i am in taxi driver team iit says the command OK! but it say + SERVER: Unknown Command

so it show both the messages ''bla bla bla'' under this it say SERVER:Unknown Command

and when i am in food delivery team it show command normal but it show the command it doesnt matter what i type if i type /lol it will show messages if i type /iamnoobatscripting it wil lshow the mesages etc...

any help ?

i will respond leter cuz now i go outside a little at this time i hope u will help me again

ty
Try changing the return to 1 not true.


Re: Crazy Commands - Geekzor - 07.08.2009

same problem ...