Commands doesn't work.
#1

So I found a great filterscript and I used it . Then In my gamemode i had some OnPlayerCommandText commands like
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/healme", cmdtext, true, 10) == 0)
	{
		SetPlayerHealth(playerid,100);
		return 1;
	}
So when i put the filterscript the commands doesn't work any help?
Reply
#2

If command /healme is 10 characters ...
pawn Код:
if (strcmp("/healme", cmdtext, true) == 0)
{
    SetPlayerHealth(playerid,100);
        return 1;
}
Reply
#3

If you change that here is my full list of onplayercommandtext

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/healme", cmdtext, true, 10) == 0)
	{
		SetPlayerHealth(playerid,100);
		return 1;
	}
		if (strcmp("/kill", cmdtext, true, 10) == 0)
	{
		SetPlayerHealth(playerid,0);
		return 1;
	}
		if (strcmp("/armour", cmdtext, true, 10) == 0)
	{
		SetPlayerArmour(playerid,100);
		return 1;
	}
		if (strcmp("/armouroff", cmdtext, true, 10) == 0)
	{
		SetPlayerArmour(playerid,0);
		return 1;
	}
		if (strcmp("/spray", cmdtext, true, 10) == 0)
	{
		SetVehicleHealth(402,100);
		return 1;
	}
		if (strcmp("/w2 minigun", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,38,9999);
		return 1;
	}
		if (strcmp("/w2 Satchel Charger", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,39,9999);
		return 1;
	}
		if (strcmp("/w2 Detonator", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,40,9999);
		return 1;
	}
		if (strcmp("/money", cmdtext, true, 10) == 0)
	{
		GivePlayerMoney(playerid,99999);
		return 1;
	}
		if (strcmp("/t 1", cmdtext, true, 10) == 0)
	{
		SetPlayerTime(playerid,00,00);
		return 1;
	}
			if (strcmp("/w2 Unarmed", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,0,9999);
		return 1;
	}
			if (strcmp("/w2 Brass Knuckles", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,1,9999);
		return 1;
	}
			if (strcmp("/w2 Golf Club", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,2,9999);
		return 1;
	}
			if (strcmp("/w2 Nite Stick", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,3,9999);
		return 1;
	}
			if (strcmp("/w2 Knife", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,4,9999);
		return 1;
	}
			if (strcmp("/w2 Baseball Bat", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,5,9999);
		return 1;
	}
			if (strcmp("/w2 Shovel", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,6,9999);
		return 1;
	}
			if (strcmp("/w2 Pool Cue", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,7,9999);
		return 1;
	}
			if (strcmp("/w2 Cane", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,15,9999);
		return 1;
	}
			if (strcmp("/w2 Tear Gas", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,16,9999);
		return 1;
	}
			if (strcmp("/w2 Grenade", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,17,9999);
		return 1;
	}
			if (strcmp("/w2 Molotov", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,18,9999);
		return 1;
	}
			if (strcmp("/w2 9mm", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,22,9999);
		return 1;
	}
			if (strcmp("/w2 Silenced", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,23,9999);
		return 1;
	}
			if (strcmp("/w2 Desert Eagle", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,24,9999);
		return 1;
	}
			if (strcmp("/w2 Micro SMG", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,28,9999);
		return 1;
	}
		if (strcmp("/remove", cmdtext, true, 10) == 0)
	{
		ResetPlayerWeapons(playerid);
		return 1;
	}
	return 0;
}
Reply
#4

Quote:
Originally Posted by Affan
Посмотреть сообщение
If you change that here is my full list of onplayercommandtext

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/healme", cmdtext, true, 10) == 0)
	{
		SetPlayerHealth(playerid,100);
		return 1;
	}
		if (strcmp("/kill", cmdtext, true, 10) == 0)
	{
		SetPlayerHealth(playerid,0);
		return 1;
	}
		if (strcmp("/armour", cmdtext, true, 10) == 0)
	{
		SetPlayerArmour(playerid,100);
		return 1;
	}
		if (strcmp("/armouroff", cmdtext, true, 10) == 0)
	{
		SetPlayerArmour(playerid,0);
		return 1;
	}
		if (strcmp("/spray", cmdtext, true, 10) == 0)
	{
		SetVehicleHealth(402,100);
		return 1;
	}
		if (strcmp("/w2 minigun", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,38,9999);
		return 1;
	}
		if (strcmp("/w2 Satchel Charger", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,39,9999);
		return 1;
	}
		if (strcmp("/w2 Detonator", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,40,9999);
		return 1;
	}
		if (strcmp("/money", cmdtext, true, 10) == 0)
	{
		GivePlayerMoney(playerid,99999);
		return 1;
	}
		if (strcmp("/t 1", cmdtext, true, 10) == 0)
	{
		SetPlayerTime(playerid,00,00);
		return 1;
	}
			if (strcmp("/w2 Unarmed", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,0,9999);
		return 1;
	}
			if (strcmp("/w2 Brass Knuckles", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,1,9999);
		return 1;
	}
			if (strcmp("/w2 Golf Club", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,2,9999);
		return 1;
	}
			if (strcmp("/w2 Nite Stick", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,3,9999);
		return 1;
	}
			if (strcmp("/w2 Knife", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,4,9999);
		return 1;
	}
			if (strcmp("/w2 Baseball Bat", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,5,9999);
		return 1;
	}
			if (strcmp("/w2 Shovel", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,6,9999);
		return 1;
	}
			if (strcmp("/w2 Pool Cue", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,7,9999);
		return 1;
	}
			if (strcmp("/w2 Cane", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,15,9999);
		return 1;
	}
			if (strcmp("/w2 Tear Gas", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,16,9999);
		return 1;
	}
			if (strcmp("/w2 Grenade", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,17,9999);
		return 1;
	}
			if (strcmp("/w2 Molotov", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,18,9999);
		return 1;
	}
			if (strcmp("/w2 9mm", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,22,9999);
		return 1;
	}
			if (strcmp("/w2 Silenced", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,23,9999);
		return 1;
	}
			if (strcmp("/w2 Desert Eagle", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,24,9999);
		return 1;
	}
			if (strcmp("/w2 Micro SMG", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid,28,9999);
		return 1;
	}
		if (strcmp("/remove", cmdtext, true, 10) == 0)
	{
		ResetPlayerWeapons(playerid);
		return 1;
	}
	return 0;
}
Poorly done commands but whatever
If you mean correct the mistakes with the 10 chars.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/healme", cmdtext, true) == 0)
    {
        SetPlayerHealth(playerid,100);
        return 1;
    }
        if (strcmp("/kill", cmdtext, true) == 0)
    {
        SetPlayerHealth(playerid,0);
        return 1;
    }
        if (strcmp("/armour", cmdtext, true) == 0)
    {
        SetPlayerArmour(playerid,100);
        return 1;
    }
        if (strcmp("/armouroff", cmdtext, true) == 0)
    {
        SetPlayerArmour(playerid,0);
        return 1;
    }
        if (strcmp("/spray", cmdtext, true) == 0)
    {
        SetVehicleHealth(402,100);
        return 1;
    }
        if (strcmp("/w2 minigun", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,38,9999);
        return 1;
    }
        if (strcmp("/w2 Satchel Charger", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,39,9999);
        return 1;
    }
        if (strcmp("/w2 Detonator", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,40,9999);
        return 1;
    }
        if (strcmp("/money", cmdtext, true) == 0)
    {
        GivePlayerMoney(playerid,99999);
        return 1;
    }
        if (strcmp("/t 1", cmdtext, true) == 0)
    {
        SetPlayerTime(playerid,00,00);
        return 1;
    }
            if (strcmp("/w2 Unarmed", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,0,9999);
        return 1;
    }
            if (strcmp("/w2 Brass Knuckles", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,1,9999);
        return 1;
    }
            if (strcmp("/w2 Golf Club", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,2,9999);
        return 1;
    }
            if (strcmp("/w2 Nite Stick", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,3,9999);
        return 1;
    }
            if (strcmp("/w2 Knife", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,4,9999);
        return 1;
    }
            if (strcmp("/w2 Baseball Bat", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,5,9999);
        return 1;
    }
            if (strcmp("/w2 Shovel", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,6,9999);
        return 1;
    }
            if (strcmp("/w2 Pool Cue", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,7,9999);
        return 1;
    }
            if (strcmp("/w2 Cane", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,15,9999);
        return 1;
    }
            if (strcmp("/w2 Tear Gas", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,16,9999);
        return 1;
    }
            if (strcmp("/w2 Grenade", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,17,9999);
        return 1;
    }
            if (strcmp("/w2 Molotov", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,18,9999);
        return 1;
    }
            if (strcmp("/w2 9mm", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,22,9999);
        return 1;
    }
            if (strcmp("/w2 Silenced", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,23,9999);
        return 1;
    }
            if (strcmp("/w2 Desert Eagle", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,24,9999);
        return 1;
    }
            if (strcmp("/w2 Micro SMG", cmdtext, true) == 0)
    {
        GivePlayerWeapon(playerid,28,9999);
        return 1;
    }
        if (strcmp("/remove", cmdtext, true) == 0)
    {
        ResetPlayerWeapons(playerid);
        return 1;
    }
    return 0;
}
Reply
#5

But unfortunately the /healme still doesn't work.
Reply
#6

Remove the 10 from all commands.
And what do you mean by 'the commands doesn't works'?

EDIT:
Maybe in the filterscript you already have /healme.
Reply
#7

Affan just replace with this one

pawn Код:
if (strcmp("/healme", cmdtext, true) == 0)
    {
        SetPlayerHealth(playerid,100);
        return 1;
    }
Reply
#8

@faisal: Like /healme doesn't work. Before i put the filterscript it all worked. for some reason its now. :/
@zohartrejx: I tried that, doesn't work.
@faisal: It does. Is that the reason?
Reply
#9

Oh, well then use this one

pawn Код:
}
    if (strcmp("/healme", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, COLOR_RED, "Suscefully Healed.");
        SetPlayerHealth(playerid, 100);
        return 1;
Reply
#10

Quote:
Originally Posted by zohartrejx
Посмотреть сообщение
Affan just replace with this one

pawn Код:
if (strcmp("/healme", cmdtext, true) == 0)
    {
        SetPlayerHealth(playerid,100);
        return 1;
    }
It's the exact same thing that i've given him it doesn't work can't you read ?
He probably already has the /healme command because it should work just fine.
p.s:
Quote:
Originally Posted by zohartrejx
Посмотреть сообщение
}
if (strcmp("/healme", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_RED, "Suscefully Healed.");
SetPlayerHealth(playerid, 100);
return 1;
That won't work.. because /healme doesn't have 10 chars and also you misspelled " Suscefully "
And the brackets.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)