Command coded but not working.
#1

I have implemented some Donator commands and yes I am Donator Rank 3 in game. One of the commands is to enter the donator lounge which is /dlenter shows up as "uNKNOWN COMMAND" even though I am at the spot where it is meant to be used

Код:
	if(strcmp(cmd,"/dlenter",true)==0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 2, 1797.9247,-1578.6771,14.0893))// LS DONATOR LOUNGE Area near Alhambra and Unity Station
		{
			if(PlayerInfo[playerid][pDonateRank]=1) {
			    SetPlayerPos(playerid, 2262.6274,-1486.6484,1301.0859);
			    SendClientMessage(playerid,COLOR_GRAD2,"Donator Lounge Entered.");
			    return 1;
			}
			else if(PlayerInfo[playerid][pDonateRank]=2) {
			    SetPlayerPos(playerid, 2262.6274,-1486.6484,1301.0859);
			    SendClientMessage(playerid,COLOR_GRAD2,"Donator Lounge Entered.");
			    return 1;
			}
			else if(PlayerInfo[playerid][pDonateRank]=3) {
			    SetPlayerPos(playerid, 2262.6274,-1486.6484,1301.0859);
			    SendClientMessage(playerid,COLOR_GRAD2,"Donator Lounge Entered.");
			    return 1;
			}
			return 1;
	  	}
		else
		{
  			SendClientMessage(playerid,COLOR_GRAD2,"You are not a Donator/VIP. Visit our store to purchase.");
	        return 1;
        }
        return 1;
	}
	
	if(strcmp(cmd,"/dlexit",true)==0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 2, 2262.6274,-1486.6484,1301.0859))
		{
			    SetPlayerPos(playerid, 1797.9247,-1578.6771,14.0893);
			    SendClientMessage(playerid,COLOR_GRAD2,"Donator Lounge Exited.");
			    return 1;
		}
		return 1;
	}

	if(strcmp(cmd,"/dlocker",true)==0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 2, 2276.4619,-1494.6659,1301.0859))
		{
			if(PlayerInfo[playerid][pDonateRank]=1) {
                ShowPlayerDialog(playerid, DLOCKER_DIALOG, DIALOG_STYLE_LIST, "Donator Locker", "Refill Health\n Kevlar Armour     COST:$1500", "Confirm", "Cancel");
			    return 1;
			}
			else if(PlayerInfo[playerid][pDonateRank]=2) {
				ShowPlayerDialog(playerid, DLOCKER_DIALOG, DIALOG_STYLE_LIST, "Donator Locker", "Refill Health\n Kevlar Armour     COST:$1500", "Confirm", "Cancel");
			    return 1;
			}
			else if(PlayerInfo[playerid][pDonateRank]=3) {
				ShowPlayerDialog(playerid, DLOCKER_DIALOG, DIALOG_STYLE_LIST, "Donator Locker", "Refill Health\n Kevlar Armour     COST:$1500", "Confirm", "Cancel");
			    return 1;
			}
			else {
				SendClientMessage(playerid,COLOR_GRAD2,"You are not a Donator. Visit the store to purchase.");
			    return 1;
			}
			return 1;
	    }
	    else {
	        SendClientMessage(playerid,COLOR_GRAD2,"You are not at the Donator Locker.");
	        return 1;
	    }
	    return 1;
	}
Although I am getting no errors, its not working. I didnt try the other commands
Reply
#2

make sure that you are not using this
pawn Код:
#include <zcmd>
it blocks onplayercommandtext.
Reply
#3

Quote:
Originally Posted by Anak
Посмотреть сообщение
make sure that you are not using this
pawn Код:
#include <zcmd>
it blocks onplayercommandtext.
Nope, im not using that include and I have placed it under onplayercommandtext callback. Is it something to do with the return 1; thingy?
Reply
#4

Run nativechecker or crashdetect to find the problem
Reply
#5

I mean all other commands work and I have put these in the same place under the same callback, I am using LSL-RP script
Reply
#6

PHP код:
if(strcmp(cmd,"/dlenter",true)==0)
    {
        if(
IsPlayerInRangeOfPoint(playerid21797.9247,-1578.6771,14.0893))// LS DONATOR LOUNGE Area near Alhambra and Unity Station
        
{
            if(
PlayerInfo[playerid][pDonateRank]=1) {
                
SetPlayerPos(playerid2262.6274,-1486.6484,1301.0859);
                
SendClientMessage(playerid,COLOR_GRAD2,"Donator Lounge Entered.");
                return 
1;
            }
            else if(
PlayerInfo[playerid][pDonateRank]=2) {
                
SetPlayerPos(playerid2262.6274,-1486.6484,1301.0859);
                
SendClientMessage(playerid,COLOR_GRAD2,"Donator Lounge Entered.");
                return 
1;
            }
            else if(
PlayerInfo[playerid][pDonateRank]=3) {
                
SetPlayerPos(playerid2262.6274,-1486.6484,1301.0859);
                
SendClientMessage(playerid,COLOR_GRAD2,"Donator Lounge Entered.");
                return 
1;
            }
          }
        else
        {
              
SendClientMessage(playerid,COLOR_GRAD2,"You are not a Donator/VIP. Visit our store to purchase.");
            return 
1;
        }
        return 
1;
    } 
Reply
#7

Quote:
Originally Posted by yusei
Посмотреть сообщение
PHP код:
if(strcmp(cmd,"/dlenter",true)==0)
    {
        if(
IsPlayerInRangeOfPoint(playerid21797.9247,-1578.6771,14.0893))// LS DONATOR LOUNGE Area near Alhambra and Unity Station
        
{
            if(
PlayerInfo[playerid][pDonateRank]=1) {
                
SetPlayerPos(playerid2262.6274,-1486.6484,1301.0859);
                
SendClientMessage(playerid,COLOR_GRAD2,"Donator Lounge Entered.");
                return 
1;
            }
            else if(
PlayerInfo[playerid][pDonateRank]=2) {
                
SetPlayerPos(playerid2262.6274,-1486.6484,1301.0859);
                
SendClientMessage(playerid,COLOR_GRAD2,"Donator Lounge Entered.");
                return 
1;
            }
            else if(
PlayerInfo[playerid][pDonateRank]=3) {
                
SetPlayerPos(playerid2262.6274,-1486.6484,1301.0859);
                
SendClientMessage(playerid,COLOR_GRAD2,"Donator Lounge Entered.");
                return 
1;
            }
          }
        else
        {
              
SendClientMessage(playerid,COLOR_GRAD2,"You are not a Donator/VIP. Visit our store to purchase.");
            return 
1;
        }
        return 
1;
    } 
Can I ask what you did apart from fixing the layout/indentation.
Reply
#8

in your server.cfg, show me what you have on the filterscript line, i had the same problem with commands, and it was caused because of an admin system
Reply
#9

Quote:

Can I ask what you did apart from fixing the layout/indentation

Код:
if(IsPlayerInRangeOfPoint(playerid, 2, 1797.9247,-1578.6771,14.0893))// LS DONATOR LOUNGE Area near Alhambra and Unity Station
		{
			if(PlayerInfo[playerid][pDonateRank]=1) {
			    SetPlayerPos(playerid, 2262.6274,-1486.6484,1301.0859);
			    SendClientMessage(playerid,COLOR_GRAD2,"Donator Lounge Entered.");
			    return 1;
			}
			else if(PlayerInfo[playerid][pDonateRank]=2) {
			    SetPlayerPos(playerid, 2262.6274,-1486.6484,1301.0859);
			    SendClientMessage(playerid,COLOR_GRAD2,"Donator Lounge Entered.");
			    return 1;
			}
			else if(PlayerInfo[playerid][pDonateRank]=3) {
			    SetPlayerPos(playerid, 2262.6274,-1486.6484,1301.0859);
			    SendClientMessage(playerid,COLOR_GRAD2,"Donator Lounge Entered.");
			    return 1;
			}
			return 1;
	  	}
Reply
#10

Quote:
Originally Posted by Abhishek.
Посмотреть сообщение
in your server.cfg, show me what you have on the filterscript line, i had the same problem with commands, and it was caused because of an admin system
I am using no filterscripts, I am using a gamemode LSL-RP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)