Wow? I got a small problem help please.
#1

Okay so I made a /kill command.
This is my code
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/kill", cmdtext, true, 10) == 0)
	{
	SetPlayerHealth(playerid, 0);
		return 1;
	}
	return 0;
}
and when I press f5 in pwano that what I get
Код:
C:\Documents and Settings\Alex\Desktop\samp\gamemodes\howtomakegm.pwn(85) : error 021: symbol already defined: "OnPlayerCommandText"
C:\Documents and Settings\Alex\Desktop\samp\gamemodes\howtomakegm.pwn(89) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
okay so lets delete onplayercomandtext

that what i have now
Код:
	if (strcmp("/kill", cmdtext, true, 10) == 0)
	{
	SetPlayerHealth(playerid, 0);
		return 1;
	}
	return 0;
}
here is the error:
Код:
C:\Documents and Settings\Alex\Desktop\samp\gamemodes\howtomakegm.pwn(84) : error 010: invalid function or declaration
C:\Documents and Settings\Alex\Desktop\samp\gamemodes\howtomakegm.pwn(87) : error 010: invalid function or declaration
C:\Documents and Settings\Alex\Desktop\samp\gamemodes\howtomakegm.pwn(89) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
so here is my help and kill command

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/help", cmdtext, true, 10) == 0)
	{
  SendClientMessage(playerid, 0xC0C0C0FF, "Help Commands");
  SendClientMessage(playerid, 0xC0C0C0FF, "Type /kill to kill your self");
  SendClientMessage(playerid, 0xC0C0C0FF, "Type /q to quit the server");
	}
	return 0;
}
	if (strcmp("/kill", cmdtext, true, 10) == 0)
	{
	SetPlayerHealth(playerid, 0);
		return 1;
	}
	return 0;
}
Please help me xD
Reply
#2

Put this code under OnPlayerCommandText:

Kill:

Код:
	if(strcmp(cmdtext, "/kill", true) == 0)
	{
		SetPlayerHealth(playerid,0.0);
		SendClientMessage(playerid, COLOR_ftw, "Your Text Here");
		return 1;
	}
Help (my way):

Код:
  if(strcmp(cmdtext, "/help", true) == 0)
	{
	  SendClientMessage(playerid,COLOR_ftw," ");
	  SendClientMessage(playerid,COLOR_ftw,"Help:");
	  SendClientMessage(playerid,COLOR_ftw,"*******");
	  SendClientMessage(playerid,COLOR_ftw," hai imah nop");
	  SendClientMessage(playerid,COLOR_ftw," text :D");
	  SendClientMessage(playerid,COLOR_ftw," textz0r");
	  SendClientMessage(playerid,COLOR_ftw," ");
	  SendClientMessage(playerid,COLOR_ftw,"Commands:");
	  SendClientMessage(playerid,COLOR_ftw,"*******");
	  SendClientMessage(playerid,COLOR_ftw,"For commandslist: type /commands.");
	  SendClientMessage(playerid,COLOR_ftw," ");
		return 1;
 	}
Obtw, about onplayercommandtext, you have an other one already. Search with CTRL + F
Reply
#3

Thank you now I get this error
Quote:

C:\Documents and Settings\Alex\Desktop\samp\gamemodes\howtomakegm.p wn(97) : error 030: compound statement not closed at the end of file (started at line 76)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Line 74-84
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmdtext, "/help", true) == 0)
	{
	  SendClientMessage(playerid,0xAAFFCC33,"Help List");
	  SendClientMessage(playerid,0xAAFFCC33,"For Help type /help");
	  SendClientMessage(playerid,0xAAFFCC33,"To kill your self tpye /kill");
	  SendClientMessage(playerid,0xAAFFCC33,"To have godmod type /godmod");

		return 1;
 	}
Reply
#4

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmdtext, "/help", true) == 0)
	{
	  SendClientMessage(playerid,0xAAFFCC33,"Help List");
	  SendClientMessage(playerid,0xAAFFCC33,"For Help type /help");
	  SendClientMessage(playerid,0xAAFFCC33,"To kill your self tpye /kill");
	  SendClientMessage(playerid,0xAAFFCC33,"To have godmod type /godmod");

		return 1;
 	}
return 0;
}
Reply
#5

u have 2 : OnPlayerCommandText On Your Script thats for the error "already defined"
Reply
#6

Quote:
Originally Posted by Etch ❽ H
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmdtext, "/help", true) == 0)
	{
	  SendClientMessage(playerid,0xAAFFCC33,"Help List");
	  SendClientMessage(playerid,0xAAFFCC33,"For Help type /help");
	  SendClientMessage(playerid,0xAAFFCC33,"To kill your self tpye /kill");
	  SendClientMessage(playerid,0xAAFFCC33,"To have godmod type /godmod");

		return 1;
 	}
return 0;
}
C:\Documents and Settings\Alex\Desktop\samp\gamemodes\howtomakegm.p wn(85) : warning 217: loose indentation
C:\Documents and Settings\Alex\Desktop\samp\gamemodes\howtomakegm.p wn(87) : error 010: invalid function or declaration
C:\Documents and Settings\Alex\Desktop\samp\gamemodes\howtomakegm.p wn(91) : error 010: invalid function or declaration
C:\Documents and Settings\Alex\Desktop\samp\gamemodes\howtomakegm.p wn(93) : error 010: invalid function or declaration
C:\Documents and Settings\Alex\Desktop\samp\gamemodes\howtomakegm.p wn(97) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

EDIT:

Line 74-98
Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/help", true) == 0)
{
SendClientMessage(playerid,0xAAFFCC33,"Help List");
SendClientMessage(playerid,0xAAFFCC33,"For Help type /help");
SendClientMessage(playerid,0xAAFFCC33,"To kill your self tpye /kill");
SendClientMessage(playerid,0xAAFFCC33,"To have godmod type /godmod");

return 1;
}
return 0;
}
if(strcmp(cmdtext, "/kill", true) == 0)
{
SetPlayerHealth(playerid,0.0);
SendClientMessage(playerid, 0xC0C0C0FF, "Faggot.. Killed your Self Oh Wow!!!!");
return 1;
}
if(strcmp(cmdtext, "/godmod", true) == 0)
{
SetPlayerHealth(playerid,100000000.100000);
SendClientMessage(playerid, 0xC0C0C0FF, "NOOB CHEATER!, Oh well");
return 0;
}

Reply
#7

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmdtext, "/help", true) == 0)
  {
    SendClientMessage(playerid,0xAAFFCC33,"Help List");
    SendClientMessage(playerid,0xAAFFCC33,"For Help type /help");
    SendClientMessage(playerid,0xAAFFCC33,"To kill your self tpye /kill");
    SendClientMessage(playerid,0xAAFFCC33,"To have godmod type /godmod");
   return 1;
  }
  if(strcmp(cmdtext, "/kill", true) == 0)
  {
   SetPlayerHealth(playerid,0.0);
   SendClientMessage(playerid, 0xC0C0C0FF, "Faggot.. Killed your Self Oh Wow!!!!");
   return 1;
  }
  if(strcmp(cmdtext, "/godmod", true) == 0)
  {
   SetPlayerHealth(playerid,100000000.100000);
   SendClientMessage(playerid, 0xC0C0C0FF, "NOOB CHEATER!, Oh well");
   return 1;
  }
  return 0;
}
That should do it
Reply
#8

Quote:
Originally Posted by Fj0rtizFredde
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmdtext, "/help", true) == 0)
 {
   SendClientMessage(playerid,0xAAFFCC33,"Help List");
   SendClientMessage(playerid,0xAAFFCC33,"For Help type /help");
   SendClientMessage(playerid,0xAAFFCC33,"To kill your self tpye /kill");
   SendClientMessage(playerid,0xAAFFCC33,"To have godmod type /godmod");
   return 1;
  }
 if(strcmp(cmdtext, "/kill", true) == 0)
 {
   SetPlayerHealth(playerid,0.0);
   SendClientMessage(playerid, 0xC0C0C0FF, "Faggot.. Killed your Self Oh Wow!!!!");
   return 1;
 }
 if(strcmp(cmdtext, "/godmod", true) == 0)
 {
   SetPlayerHealth(playerid,100000000.100000);
   SendClientMessage(playerid, 0xC0C0C0FF, "NOOB CHEATER!, Oh well");
   return 1;
 }
 return 0;
}
That should do it
Thank you.

i got only two warnings
Quote:

C:\Documents and Settings\Alex\Desktop\samp\gamemodes\howtomakegm.p wn(82) : warning 217: loose indentation
C:\Documents and Settings\Alex\Desktop\samp\gamemodes\howtomakegm.p wn(84) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Warnings.

Reply
#9

those warnings are not harmful so u can use on top of ur script under ur includes :
Код:
#pragma tabsize 0
Reply
#10

bro' just stop putting everywhere the Public OnPlayerCommandText
You Have to put it if you just using FilterScript If you putting it in an GM so you dont have to put it Becasue it just Under The Public so..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)