Cmd problems
#1

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;
}
Reply
#2

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;
}
Reply
#3

Still not working for me...

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

Not working.
Reply
#4

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

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

No errors, Clean, But IG Cmds not working.
Reply
#6

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)