SA-MP Forums Archive
Cmd problems - 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: Cmd problems (/showthread.php?tid=119614)



Cmd problems - Taz86 - 08.01.2010

Well Hey guys
My friend got problems in his server
He got this lines, But IG, They aint working, Why?
Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
	if(strcmp(cmdtext,"/learn",true)==0)
	{
	  SendClientMessage(playerid,COLOR_YELLOW,"Hello And Welcome To the Server, Some info over here.");
	  SendClientMessage(playerid,COLOR_YELLOW,"If you are Zombie, Use the Knife To infect the humans.");
	  SendClientMessage(playerid,COLOR_YELLOW,"If you are Human, You can Run Or Stay and kill the Zombies With your guns.");
		SendClientMessage(playerid,COLOR_YELLOW,"If You want to change team Do F4 Than /kill.");
	  SendClientMessage(playerid,COLOR_RED,"Note: Zombies Got 150 HP, Humans Got 100 HP.");
	  SendClientMessage(playerid,COLOR_GREEN,"What you waiting for? Enjoy!!");
	}
	if(strcmp(cmdtext,"/kill",true)==0)
	{
	SetPlayerHealth(playerid, 0.0);
	SendClientMessage(playerid,COLOR_YELLOW,"You just killed yourself.");
	return 1;
	}
	
	return 1;
}



Re: Cmd problems - bajskorv123 - 08.01.2010

Simple, you forgot returning the learn command, try this code
Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
	if(strcmp(cmdtext,"/learn",true)==0)
	{
	  SendClientMessage(playerid,COLOR_YELLOW,"Hello And Welcome To the Server, Some info over here.");
	  SendClientMessage(playerid,COLOR_YELLOW,"If you are Zombie, Use the Knife To infect the humans.");
	  SendClientMessage(playerid,COLOR_YELLOW,"If you are Human, You can Run Or Stay and kill the Zombies With your guns.");
	  SendClientMessage(playerid,COLOR_YELLOW,"If You want to change team Do F4 Than /kill.");
	  SendClientMessage(playerid,COLOR_RED,"Note: Zombies Got 150 HP, Humans Got 100 HP.");
	  SendClientMessage(playerid,COLOR_GREEN,"What you waiting for? Enjoy!!");
       return 1;
	}
	if(strcmp(cmdtext,"/kill",true)==0)
	{
	  SetPlayerHealth(playerid, 0.0);
	  SendClientMessage(playerid,COLOR_YELLOW,"You just killed yourself.");
	  return 1;
	}
	
	return 1;
}



Re: Cmd problems - Taz86 - 08.01.2010

Still not working for me...

If you want i can pm you the server ip and you can see it also..

Not working.


Re: Cmd problems - bajskorv123 - 08.01.2010

Why not show me the erros you get when you compile instead? If there are any


Re: Cmd problems - Taz86 - 08.01.2010

No, If there was errors, I was giving them.

No errors, Clean, But IG Cmds not working.


Re: Cmd problems - Doppeyy - 08.01.2010

pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
    if(strcmp(cmdtext,"/learn",true)==0)
    {
      SendClientMessage(playerid,COLOR_YELLOW,"Hello And Welcome To the Server, Some info over here.");
      SendClientMessage(playerid,COLOR_YELLOW,"If you are Zombie, Use the Knife To infect the humans.");
      SendClientMessage(playerid,COLOR_YELLOW,"If you are Human, You can Run Or Stay and kill the Zombies With your guns.");
      SendClientMessage(playerid,COLOR_YELLOW,"If You want to change team Do F4 Than /kill.");
      SendClientMessage(playerid,COLOR_RED,"Note: Zombies Got 150 HP, Humans Got 100 HP.");
      SendClientMessage(playerid,COLOR_GREEN,"What you waiting for? Enjoy!!");
       return 1;
    }
    if(strcmp(cmdtext,"/kill",true)==0)
    {
      SetPlayerHealth(playerid, 0.0);
      SendClientMessage(playerid,COLOR_YELLOW,"You just killed yourself.");
      return 1;
    }
   
    return 0;
}
Try it with a return 0; at the end.

Edit : WHOOHOO 700 posts .

[Doppeyy