SA-MP Forums Archive
How do i add this? - 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: How do i add this? (/showthread.php?tid=88580)



How do i add this? - killdahobo99 - 27.07.2009

I'm trying to learn how to add teams from the sa-mp wiki.

I've followed everything correctly and its all fine. What i want to do now is, add certain commands for certain teams...How do i do that tho?


Heres my pastebin: http://pastebin.com/m38bc3b5c

On "OnPlayerCommandText" i want to add say...."/help" and it will display it only for 1 team how can i do that with what i have got so far in my pastebin?

Thanks for the help


Re: How do i add this? - Criss_Angel - 27.07.2009

Quote:
Originally Posted by killdahobo99
I'm trying to learn how to add teams from the sa-mp wiki.

I've followed everything correctly and its all fine. What i want to do now is, add certain commands for certain teams...How do i do that tho?


Heres my pastebin: http://pastebin.com/m38bc3b5c

On "OnPlayerCommandText" i want to add say...."/help" and it will display it only for 1 team how can i do that with what i have got so far in my pastebin?

Thanks for the help
uhm..maybe /help
Код:
	if (strcmp("/help", cmdtext, true, 10) == 0)
	{
	 if(gTeam[playerid]== Team_Grove)
	 {
	 // bla bla bla..C
	 }
	 else
	 {
	 // bla bla bla
	 }
		return 1;
	}



Re: How do i add this? - killdahobo99 - 27.07.2009

This is what i have


Код:
 if (strcmp(cmdtext, "/ahelp", true) == 0) // ----------GUNZ COMMAND JUST FOR ADMIN
	{
	if (gTeam[playerid] == TEAM_GROVE)
	{
	SendClientMessage(playerid, 0xFF0000AA, "Only GROVE are authorized to use this command!");
	return 1;
	}
	else
	SendClientMessage(playerid,COLOR_LIGHTBLUE, "A FEW ADMIN COMMANDS");
	return 1;
  }
and heres the error i get

Код:
147) : warning 209: function "OnPlayerCommandText" should return a value



Re: How do i add this? - Criss_Angel - 27.07.2009

Quote:
Originally Posted by killdahobo99
This is what i have


Код:
 if (strcmp(cmdtext, "/ahelp", true) == 0) // ----------GUNZ COMMAND JUST FOR ADMIN
	{
	if (gTeam[playerid] == TEAM_GROVE)
	{
	SendClientMessage(playerid, 0xFF0000AA, "Only GROVE are authorized to use this command!");
	return 1;
	}
	else
	SendClientMessage(playerid,COLOR_LIGHTBLUE, "A FEW ADMIN COMMANDS");
	return 1;
  }
and heres the error i get

Код:
147) : warning 209: function "OnPlayerCommandText" should return a value
Add one more } at the end