Unknown Command
#1

hey all i have a little probleme again ....
this time it's about commands
when i join he server and i type /shop nothing happen
pawn Код:
CMD:shop(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 40, 286.148986,-40.644397,1001.515625) || IsPlayerInRangeOfPoint(playerid, 40, 286.800994,-82.547599,1001.515625) || IsPlayerInRangeOfPoint(playerid, 40, 296.919982,-108.071998,1001.515625) || IsPlayerInRangeOfPoint(playerid, 40, 314.820983,-141.431991,999.601562) || IsPlayerInRangeOfPoint(playerid, 40, 316.524993,-167.706985,999.593750))
    ShowPlayerDialog(playerid, DIALOGWEAPONS, DIALOG_STYLE_LIST, "Hello, need gun ??", "Deagle(15k)\nShotgun(2.5k)\nMP5(2k)\nSpas12(5k)\nAK-47(3k)\nM4(3.5k)\nSniper(1k)\nHalf vest(5k)\nFull vest(2.5k)","Buy","Cancel");
    return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
if(dialogid == DIALOGWEAPONS)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
            {
                if(GetPlayerMoney(playerid) <1500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item! chea!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a deagle!");
                GivePlayerMoney(playerid, -1500);
                GivePlayerWeapon(playerid,24, 9999999);
            }
                case 1:
            {
                if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a shotgun ");
                GivePlayerMoney(playerid, -2500);
                GivePlayerWeapon(playerid, 25, 9999999);
            }
                case 2:
            {
                if(GetPlayerMoney(playerid) <2000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought an MP5!");
                GivePlayerMoney(playerid, -2000);
                GivePlayerWeapon(playerid, 29 ,9999999);
            }
                case 3:
            {
                if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a spas");
                GivePlayerMoney(playerid, -5000);
                GivePlayerWeapon(playerid, 27, 9999999);
            }
                case 4:
            {
                if(GetPlayerMoney(playerid) <3000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought an AK-47 for 50k!");
                GivePlayerMoney(playerid, -3000);
                GivePlayerWeapon(playerid,30 ,9999999);
            }
                case 5:
            {
                if(GetPlayerMoney(playerid) <3500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought an M4 for 60k!");
                GivePlayerMoney(playerid, -3500);
                GivePlayerWeapon(playerid, 31, 9999999);
            }
                case 6:
            {
                if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a sniper for 150k!");
                GivePlayerMoney(playerid, -10000);
                GivePlayerWeapon(playerid, 34, 9999999);
            }
                case 7:
            {
                if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");

                new Float:armour;
                GetPlayerArmour(playerid, armour);
                if(armour == 100) return SendClientMessage(playerid, COLOR_RED,"You already have a full vest!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a half vest for 10k!");
                GivePlayerMoney(playerid, -5000);
                SetPlayerArmour(playerid, 50);
            }
                case 8:
            {
                if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");

                new Float:armour;
                GetPlayerArmour(playerid, armour);
                if(armour == 100) return SendClientMessage(playerid, COLOR_RED, "You already have a full vest!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a full vest for 20k!");
                GivePlayerMoney(playerid, -2500);
                SetPlayerArmour(playerid, 100);
            }

            }
            return 1;
    }
}
thx for helping
Reply
#2

Replace the Dialogresponse with this:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{ //Hehe.
if(dialogid == DIALOGWEAPONS)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
            {
                if(GetPlayerMoney(playerid) <1500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item! chea!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a deagle!");
                GivePlayerMoney(playerid, -1500);
                GivePlayerWeapon(playerid,24, 9999999);
            }
                case 1:
            {
                if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a shotgun ");
                GivePlayerMoney(playerid, -2500);
                GivePlayerWeapon(playerid, 25, 9999999);
            }
                case 2:
            {
                if(GetPlayerMoney(playerid) <2000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought an MP5!");
                GivePlayerMoney(playerid, -2000);
                GivePlayerWeapon(playerid, 29 ,9999999);
            }
                case 3:
            {
                if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a spas");
                GivePlayerMoney(playerid, -5000);
                GivePlayerWeapon(playerid, 27, 9999999);
            }
                case 4:
            {
                if(GetPlayerMoney(playerid) <3000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought an AK-47 for 50k!");
                GivePlayerMoney(playerid, -3000);
                GivePlayerWeapon(playerid,30 ,9999999);
            }
                case 5:
            {
                if(GetPlayerMoney(playerid) <3500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought an M4 for 60k!");
                GivePlayerMoney(playerid, -3500);
                GivePlayerWeapon(playerid, 31, 9999999);
            }
                case 6:
            {
                if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a sniper for 150k!");
                GivePlayerMoney(playerid, -10000);
                GivePlayerWeapon(playerid, 34, 9999999);
            }
                case 7:
            {
                if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");

                new Float:armour;
                GetPlayerArmour(playerid, armour);
                if(armour == 100) return SendClientMessage(playerid, COLOR_RED,"You already have a full vest!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a half vest for 10k!");
                GivePlayerMoney(playerid, -5000);
                SetPlayerArmour(playerid, 50);
            }
                case 8:
            {
                if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");

                new Float:armour;
                GetPlayerArmour(playerid, armour);
                if(armour == 100) return SendClientMessage(playerid, COLOR_RED, "You already have a full vest!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a full vest for 20k!");
                GivePlayerMoney(playerid, -2500);
                SetPlayerArmour(playerid, 100);
            }

            }
            return 1;
    }
}
You should also add it to your filterscripts line in your server.cfg, or if it's a gamemode, change the gamemode to that name in your server.cfg
Reply
#3

Ooh and, can you maybe post your last 50 server_log lines? So I can take a look if it really loads the gamemode/Filterscript?
Reply
#4

Quote:
Originally Posted by bradleyofniet
Посмотреть сообщение
Replace the Dialogresponse with this:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{ //Hehe.
if(dialogid == DIALOGWEAPONS)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
            {
                if(GetPlayerMoney(playerid) <1500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item! chea!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a deagle!");
                GivePlayerMoney(playerid, -1500);
                GivePlayerWeapon(playerid,24, 9999999);
            }
                case 1:
            {
                if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a shotgun ");
                GivePlayerMoney(playerid, -2500);
                GivePlayerWeapon(playerid, 25, 9999999);
            }
                case 2:
            {
                if(GetPlayerMoney(playerid) <2000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought an MP5!");
                GivePlayerMoney(playerid, -2000);
                GivePlayerWeapon(playerid, 29 ,9999999);
            }
                case 3:
            {
                if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a spas");
                GivePlayerMoney(playerid, -5000);
                GivePlayerWeapon(playerid, 27, 9999999);
            }
                case 4:
            {
                if(GetPlayerMoney(playerid) <3000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought an AK-47 for 50k!");
                GivePlayerMoney(playerid, -3000);
                GivePlayerWeapon(playerid,30 ,9999999);
            }
                case 5:
            {
                if(GetPlayerMoney(playerid) <3500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought an M4 for 60k!");
                GivePlayerMoney(playerid, -3500);
                GivePlayerWeapon(playerid, 31, 9999999);
            }
                case 6:
            {
                if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a sniper for 150k!");
                GivePlayerMoney(playerid, -10000);
                GivePlayerWeapon(playerid, 34, 9999999);
            }
                case 7:
            {
                if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");

                new Float:armour;
                GetPlayerArmour(playerid, armour);
                if(armour == 100) return SendClientMessage(playerid, COLOR_RED,"You already have a full vest!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a half vest for 10k!");
                GivePlayerMoney(playerid, -5000);
                SetPlayerArmour(playerid, 50);
            }
                case 8:
            {
                if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");

                new Float:armour;
                GetPlayerArmour(playerid, armour);
                if(armour == 100) return SendClientMessage(playerid, COLOR_RED, "You already have a full vest!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a full vest for 20k!");
                GivePlayerMoney(playerid, -2500);
                SetPlayerArmour(playerid, 100);
            }

            }
            return 1;
    }
}
You should also add it to your filterscripts line in your server.cfg, or if it's a gamemode, change the gamemode to that name in your server.cfg
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOGWEAPONS)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
            {
                if(GetPlayerMoney(playerid) <1500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item! chea!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a deagle!");
                GivePlayerMoney(playerid, -1500);
                GivePlayerWeapon(playerid,24, 9999999);
            }
                case 1:
            {
                if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a shotgun ");
                GivePlayerMoney(playerid, -2500);
                GivePlayerWeapon(playerid, 25, 9999999);
            }
                case 2:
            {
                if(GetPlayerMoney(playerid) <2000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought an MP5!");
                GivePlayerMoney(playerid, -2000);
                GivePlayerWeapon(playerid, 29 ,9999999);
            }
                case 3:
            {
                if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a spas");
                GivePlayerMoney(playerid, -5000);
                GivePlayerWeapon(playerid, 27, 9999999);
            }
                case 4:
            {
                if(GetPlayerMoney(playerid) <3000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought an AK-47 for 50k!");
                GivePlayerMoney(playerid, -3000);
                GivePlayerWeapon(playerid,30 ,9999999);
            }
                case 5:
            {
                if(GetPlayerMoney(playerid) <3500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought an M4 for 60k!");
                GivePlayerMoney(playerid, -3500);
                GivePlayerWeapon(playerid, 31, 9999999);
            }
                case 6:
            {
                if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a sniper for 150k!");
                GivePlayerMoney(playerid, -10000);
                GivePlayerWeapon(playerid, 34, 9999999);
            }
                case 7:
            {
                if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");

                new Float:armour;
                GetPlayerArmour(playerid, armour);
                if(armour == 100) return SendClientMessage(playerid, COLOR_RED,"You already have a full vest!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a half vest for 10k!");
                GivePlayerMoney(playerid, -5000);
                SetPlayerArmour(playerid, 50);
            }
                case 8:
            {
                if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");

                new Float:armour;
                GetPlayerArmour(playerid, armour);
                if(armour == 100) return SendClientMessage(playerid, COLOR_RED, "You already have a full vest!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a full vest for 20k!");
                GivePlayerMoney(playerid, -2500);
                SetPlayerArmour(playerid, 100);
            }

            }
            return 1;
    }
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}

public ZoneTimer()
{
    for(new i=0; i < sizeof(ZoneInfo); i++) // loop all zones
    {
        if(ZoneAttacker[i] != -1) // zone is being attacked
        {
            if(GetPlayersInZone(i, ZoneAttacker[i]) >= MIN_MEMBERS_TO_START_WAR) // team has enough members in the zone
            {
                ZoneAttackTime[i]++;
                if(ZoneAttackTime[i] == TAKEOVER_TIME) // zone has been under attack for enough time and attackers take over the zone
                {
                    GangZoneStopFlashForAll(ZoneID[i]);
                    ZoneInfo[i][zTeam] = ZoneAttacker[i];
                    GangZoneShowForAll(ZoneID[i], GetTeamZoneColor(ZoneInfo[i][zTeam])); // update the zone color for new team
                    ZoneAttacker[i] = -1;
                }
            }
            else // attackers failed to take over the zone
            {
                GangZoneStopFlashForAll(ZoneID[i]);
                ZoneAttacker[i] = -1;
            }
        }
        else // check if somebody is attacking
        {
            for(new t=0; t < sizeof(Teams); t++) // loop all teams
            {
                if(Teams[t] != ZoneInfo[i][zTeam] && GetPlayersInZone(i, Teams[t]) >= MIN_MEMBERS_TO_START_WAR) // if there are enough enemies in the zone
                {
                    ZoneAttacker[i] = Teams[t];
                    ZoneAttackTime[i] = 0;
                    GangZoneFlashForAll(ZoneID[i], 0xFF000055);
                }
            }
    return 1;
    }
    }
}

CMD:cg(playerid, params[])//line 1003
pawn Код:
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(959) : error 029: invalid expression, assumed zero
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(959) : error 004: function "OnPlayerClickPlayer" is not implemented
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(964) : warning 225: unreachable code
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(964) : error 029: invalid expression, assumed zero
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(964) : error 004: function "ZoneTimer" is not implemented
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(1003) : error 029: invalid expression, assumed zero
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(1003) : error 017: undefined symbol "cmd_cg"
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(1003) : error 029: invalid expression, assumed zero
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(1003) : fatal error 107: too many error messages on one line
Reply
#5

What were the errors/warnings when you didn't added that
{ there? Remove that and compile again, post the warnings/errors here
Reply
#6

pawn Код:
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(958) : warning 209: function "OnDialogResponse" should return a value
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(1000) : warning 209: function "ZoneTimer" should return a value
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(1035) : warning 203: symbol is never used: "InDM"
C:\Users\PC\Desktop\samp\gamemodes\neeah.pwn(1035) : warning 203: symbol is never used: "veh2"
Reply
#7

Any help plz
Reply
#8

well u need to add return 0; before the last ondialogresponse } //closing bracket
Reply
#9

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
if(dialogid == DIALOGWEAPONS)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
            {
                if(GetPlayerMoney(playerid) <1500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item! chea!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a deagle!");
                GivePlayerMoney(playerid, -1500);
                GivePlayerWeapon(playerid,24, 9999999);
            }
                case 1:
            {
                if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a shotgun ");
                GivePlayerMoney(playerid, -2500);
                GivePlayerWeapon(playerid, 25, 9999999);
            }
                case 2:
            {
                if(GetPlayerMoney(playerid) <2000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought an MP5!");
                GivePlayerMoney(playerid, -2000);
                GivePlayerWeapon(playerid, 29 ,9999999);
            }
                case 3:
            {
                if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a spas");
                GivePlayerMoney(playerid, -5000);
                GivePlayerWeapon(playerid, 27, 9999999);
            }
                case 4:
            {
                if(GetPlayerMoney(playerid) <3000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought an AK-47 for 50k!");
                GivePlayerMoney(playerid, -3000);
                GivePlayerWeapon(playerid,30 ,9999999);
            }
                case 5:
            {
                if(GetPlayerMoney(playerid) <3500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought an M4 for 60k!");
                GivePlayerMoney(playerid, -3500);
                GivePlayerWeapon(playerid, 31, 9999999);
            }
                case 6:
            {
                if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a sniper for 150k!");
                GivePlayerMoney(playerid, -10000);
                GivePlayerWeapon(playerid, 34, 9999999);
            }
                case 7:
            {
                if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");

                new Float:armour;
                GetPlayerArmour(playerid, armour);
                if(armour == 100) return SendClientMessage(playerid, COLOR_RED,"You already have a full vest!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a half vest for 10k!");
                GivePlayerMoney(playerid, -5000);
                SetPlayerArmour(playerid, 50);
            }
                case 8:
            {
                if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");

                new Float:armour;
                GetPlayerArmour(playerid, armour);
                if(armour == 100) return SendClientMessage(playerid, COLOR_RED, "You already have a full vest!");
                SendClientMessage(playerid, COLOR_GREEN , "You bought a full vest for 20k!");
                GivePlayerMoney(playerid, -2500);
                SetPlayerArmour(playerid, 100);
            }

            }
            return 1;
    }
            return 0;
}
u mean like this
Reply
#10

yea
and for ZoneTimer add return 1; before last } //closing bracket
remove InDM and veh2
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)