I need help
#1

I made some commands in pawno and I go on my server and use the command and it says: SERVER: unknown command
Why wont they work?
What am i doing wrong?
Reply
#2

show your command... we don't guess
Reply
#3

Quote:
Originally Posted by andmeida10
show your command... we don't guess
Код:
	if(strcmp(cmd, "/moutbike", true) == 0)
{
	GetPlayerPos(playerid, x, y, z);
	GetPlayerFacingAngle(playerid, ang);
	CreateVehicle(510, x+1, y+1, z+1, 0, 0, 0, 600);
	SetVehicleZAngle(VehicleID, ang);
	return 1;
}
That's one of them
Reply
#4

use dcmd+sscanf they are alot easier from strcmp + strtok
Reply
#5

Quote:
Originally Posted by [AC
Etch ]
use dcmd+sscanf they are alot easier from strcmp + strtok
Still doesn't work...
Reply
#6

Quote:
Originally Posted by [TW
randomguy ]
Quote:
Originally Posted by [AC
Etch ]
use dcmd+sscanf they are alot easier from strcmp + strtok
Still doesn't work...
Maybe your typing it in another language , turkish or something?Maybe your "u" contains an umlaut ( the german crap ) or something.
Reply
#7

Post your OnPlayerCommandText
Reply
#8

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/hydra", cmdtext, true, 10) == 0)
	{
		{
	GetPlayerPos(playerid, x, y, z);
	GetPlayerFacingAngle(playerid, ang);
	CreateVehicle(510, x+1, y+1, z+1, 0, 0, 0, 600);
	SetVehicleZAngle(VehicleID, ang);
	return 1;
}
That is the code to create the command "/hydra" which spawns a hydra.
Reply
#9

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/yourcmd", cmdtext, false))
    {
        //bla bla bla
        return 1;
    }
    if(!strcmp("/anothercmd", cmdtext, false))
    {
        //more bla bla bla
        return 1;
    }
    return 0; //make absolute sure this is the last line in OnPlayerCommandText.
}
Make sure your commands look similar to that, and make sure you return 0 at the end of them all.

EDIT:
Quote:
Originally Posted by [TW
randomguy ]
Код:
	if(strcmp(cmd, "/moutbike", true) == 0)
{
	GetPlayerPos(playerid, x, y, z);
	GetPlayerFacingAngle(playerid, ang);
	CreateVehicle(510, x+1, y+1, z+1, 0, 0, 0, 600);
	SetVehicleZAngle(VehicleID, ang);
	return 1;
}
Maybe it's because you spelled "mountain bike" or "mount bike" wrong?
Reply
#10

Quote:
Originally Posted by [TW
randomguy ]
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/hydra", cmdtext, true, 10) == 0)
	{
		{
	GetPlayerPos(playerid, x, y, z);
	GetPlayerFacingAngle(playerid, ang);
	CreateVehicle(510, x+1, y+1, z+1, 0, 0, 0, 600);
	SetVehicleZAngle(VehicleID, ang);
	return 1;
}
That is the code to create the command "/hydra" which spawns a hydra.
Let me give you a lesson lol, See your opening brackets? theres not as many closed brackets to be equal.

Код:
	if (strcmp("/hydra", cmdtext, true, 10) == 0)
	{
	{
	GetPlayerPos(playerid, x, y, z);
	GetPlayerFacingAngle(playerid, ang);
	CreateVehicle(510, x+1, y+1, z+1, 0, 0, 0, 600);
	SetVehicleZAngle(VehicleID, ang);
	}
    return 1;
    }
But it looks like one of those top brackets are useless? so try this.

Код:
	if (strcmp("/hydra", cmdtext, true, 10) == 0)
	{
	GetPlayerPos(playerid, x, y, z);
	GetPlayerFacingAngle(playerid, ang);
	CreateVehicle(510, x+1, y+1, z+1, 0, 0, 0, 600);
	SetVehicleZAngle(VehicleID, ang);
    return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)