Pawn Crash On cmd
#1

Hey guys, I wont make this Long, but When i was changing the code, I got onto a Problem.
I think i fucked up somewhere but I dont know where.

http://pastebin.com/mdxUmkNS
Reply
#2

Bump, Please help..
Reply
#3

At final, you have to }} , delete one

http://pastebin.com/7GfvANpA
Reply
#4

Now im getting a LOT of errors:

Код:
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(5770 -- 5802) : error 032: array index out of bounds (variable "CarInfo")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(5982) : error 032: array index out of bounds (variable "CarInfo")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(5983) : error 032: array index out of bounds (variable "CarInfo")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(17524) : warning 219: local variable "i" shadows a variable at a preceding level
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(26799) : error 032: array index out of bounds (variable "CarInfo")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(26803) : error 032: array index out of bounds (variable "CarInfo")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(26941) : error 032: array index out of bounds (variable "CarInfo")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(26945) : error 032: array index out of bounds (variable "CarInfo")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(28028) : warning 217: loose indentation
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(28183) : warning 217: loose indentation
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(39420 -- 39427) : error 032: array index out of bounds (variable "vehTrunk")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(39467) : error 032: array index out of bounds (variable "vehTrunk")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(39468) : error 032: array index out of bounds (variable "vehTrunkAmmo")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


10 Errors.
never had them before.. lol.
Reply
#5

Anyone? Please?
Reply
#6

pawn Код:
if(strcmp(cmd, "/buy", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, 1833.4034,-1842.6157,13.5781) || IsPlayerInRangeOfPoint(playerid, 7.0, 1929.1202,-1776.2753,13.5469) || IsPlayerInRangeOfPoint(playerid, 7.0, 1352.3783,-1758.6836,13.5078)|| IsPlayerInRangeOfPoint(playerid, 7.0, 1315.4442,-897.9462,39.5781) || IsPlayerInRangeOfPoint(playerid, 7.0, 1000.1393,-919.8705,42.3281))
        {
            new x_nr[256];
            x_nr = strtok(cmdtext, idx);
            if(!strlen(x_nr))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /buy [item number]");
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "|_______ 24-7 _______|");
                SendClientMessage(playerid, COLOR_GRAD1, "| 1: Phone Book $20     2: Dice $10");
                SendClientMessage(playerid, COLOR_GRAD3, "| 3: Mask $50           4: Watch $35");
                SendClientMessage(playerid, COLOR_GRAD2, "| 5: WalkieTalkie $50   6: Spray can $90");
                SendClientMessage(playerid, COLOR_GRAD3, "| 7: Sprunk Can 3$   8: Rope $100");
                SendClientMessage(playerid, COLOR_GRAD3, "| 9: Cigarettes 20$    10: Lighter $5");
                SendClientMessage(playerid, COLOR_GRAD3, "| 11: Seeds 100$       12: Hidden Number 20$");
                SendClientMessage(playerid, COLOR_GRAD3, "| 13: MP3 Player 75$   14: Roller Skates 25$");
                SendClientMessage(playerid, COLOR_GRAD3, "| 15: Cellphone 55$   16: 20$ Phone Card 20$");
            }
            if(strcmp(x_nr,"1",true) == 0 && GetPlayerPCash(playerid)>=20)
            {
                GivePlayerPCash(playerid, - 20);
                SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You have bought a Phonebook, You can now use /number.");
                PlayerInfo[playerid][pPhoneBook] = 1;
            }
            else if(strcmp(x_nr,"2",true) == 0 && GetPlayerPCash(playerid)>=10)
            {
                GivePlayerPCash(playerid, - 10);
                SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You have bought Dice, You can now use /dice.");
                gDice[playerid] = 1;
            }
            else if(strcmp(x_nr,"3",true) == 0 && GetPlayerPCash(playerid)>=50)
            {
                if(PlayerInfo[playerid][pLevel] < 5)
                {
                    SendClientMessage(playerid,COLOR_GREY," You are not level 5 !");
                }
                else
                {
                    GivePlayerPCash(playerid, - 50);
                    SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You have bought a Mask, You can use /mask.");
                    PlayerInfo[playerid][pMask] = 1;
                }
                else if(strcmp(x_nr,"4",true) == 0 && GetPlayerPCash(playerid)>=35)
                {
                    GivePlayerPCash(playerid, - 35);
                    SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You have bought a Watch, You can now use /time.");
                    PlayerInfo[playerid][pWatch] = 1;
                }
                else if(strcmp(x_nr,"5",true) == 0 && GetPlayerPCash(playerid)>=50)
                {
                    PlayerInfo[playerid][pWalkie] = 1;
                    GivePlayerPCash(playerid, - 50);
                    SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You have bought a Walkie Talkie, Use /setfreq and /wt!");
                }
                else if(strcmp(x_nr,"6",true) == 0 && GetPlayerPCash(playerid)>=90)
                {
                    GivePlayerPCash(playerid, - 90);
                    SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You have bought a Spray Can.");
                    GivePlayerWeaponEx(playerid,41,100);
                }
                else if(strcmp(x_nr,"7",true) == 0 && GetPlayerPCash(playerid)>=3)
                {
                    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_SPRUNK);
                    GivePlayerPCash(playerid, - 7);
                    SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You have bought a sprunk can.");
                }
                else if(strcmp(x_nr,"8",true) == 0 && GetPlayerPCash(playerid)>=100)
                {
                    GivePlayerPCash(playerid, - 100);
                    Rope[playerid] = 1;
                    SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You have bought a Rope, You can use /tie now.");
                }
                else if(strcmp(x_nr,"9",true) == 0 && GetPlayerPCash(playerid)>=20)
                {
                    GivePlayerPCash(playerid, - 20);
                    PlayerInfo[playerid][pCigs] = 10;
                    SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You have bought a 10 Pack of Cigarettes, You can use /smoke.");
                }
                else if(strcmp(x_nr,"10",true) == 0 && GetPlayerPCash(playerid)>=5)
                {
                    GivePlayerPCash(playerid, - 5);
                    PlayerInfo[playerid][pLighter] = 20;
                    SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You have bought a Lighter.");
                }
                else if(strcmp(x_nr,"11",true) == 0 && GetPlayerPCash(playerid)>=100)
                {
                    if(PlayerInfo[playerid][pLevel] < 3)
                    {
                        SendClientMessage(playerid,COLOR_GREY," You are not level 3 !");
                    }
                    GivePlayerPCash(playerid, - 100);
                    WEEDS[playerid]++;
                    SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You have bought Seeds, you can type /plant.");
                }
                else if(strcmp(x_nr,"12",true) == 0 && GetPlayerPCash(playerid)>=20)
                {
                    GivePlayerPCash(playerid, - 20);
                    PlayerInfo[playerid][pHiddenNum] = 1;
                    SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You number is now off the Phone Book.");
                }
                else if(strcmp(x_nr,"13",true) == 0 && GetPlayerPCash(playerid)>=75)
                {
                    GivePlayerPCash(playerid, - 75);
                    PlayerInfo[playerid][pRadio] = 1;
                    SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You can now listen to Radio Stations.");
                }
                else if(strcmp(x_nr,"14",true) == 0 && GetPlayerPCash(playerid)>=25)
                {
                    if(PlayerInfo[playerid][pLevel] < 3)
                    {
                        SendClientMessage(playerid,COLOR_GREY," You are not level 3 !");
                    }
                    GivePlayerPCash(playerid, - 25);
                    PlayerInfo[playerid][pSkate] = 1;
                    SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You can now use /skate.");
                }
                else if(strcmp(x_nr,"15",true) == 0 && GetPlayerPCash(playerid)>=55)
                {
                    GivePlayerPCash(playerid, - 55);
                    PlayerInfo[playerid][pCellphone] = 1;
                    SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You have bought a cellphone.");
                }
                else if(strcmp(x_nr,"16",true) == 0 && GetPlayerPCash(playerid)>=20)
                {
                    if(PlayerInfo[playerid][pCellphone] == 0)
                    {
                        SendClientMessage(playerid,COLOR_GREY," You dont have a cellphone !");
                    }
                    GivePlayerPCash(playerid, - 20);
                    PlayerInfo[playerid][pCelltime] += 20;
                    SendClientMessage(playerid,COLOR_WHITE,"[INFO]: You have bought a 20 dollars phone card.");
                }
                else
                {
                    SendClientMessage(playerid,COLOR_GRAD2,"Error: Not enough money or invalid item!");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "You are not at the 24/7!");
            }
        }
    }
    return 1;
}
Reply
#7

Sorry Realcop, But I now got 2 errors more, lol.

Код:
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(5770 -- 5802) : error 032: array index out of bounds (variable "CarInfo")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(5982) : error 032: array index out of bounds (variable "CarInfo")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(5983) : error 032: array index out of bounds (variable "CarInfo")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(17524) : warning 219: local variable "i" shadows a variable at a preceding level
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(26799) : error 032: array index out of bounds (variable "CarInfo")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(26803) : error 032: array index out of bounds (variable "CarInfo")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(26941) : error 032: array index out of bounds (variable "CarInfo")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(26945) : error 032: array index out of bounds (variable "CarInfo")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(28028) : warning 217: loose indentation
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(28073) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(28073) : warning 215: expression has no effect
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(28073) : error 001: expected token: ";", but found "if"
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(28177) : warning 217: loose indentation
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(39414 -- 39421) : error 032: array index out of bounds (variable "vehTrunk")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(39461) : error 032: array index out of bounds (variable "vehTrunk")
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(39462) : error 032: array index out of bounds (variable "vehTrunkAmmo")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


12 Errors.
Reply
#8

These errors seem to have nothing to do with the code in this thread.
Reply
#9

HAHA GOT LIKE 7 ERRORS FIXED!


I got a few errors left:

Код:
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(17524) : warning 219: local variable "i" shadows a variable at a preceding level
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(28028) : warning 217: loose indentation
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(28073) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(28073) : warning 215: expression has no effect
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(28073) : error 001: expected token: ";", but found "if"
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(28177) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#10

Never. Btw:


Quote:
Originally Posted by DragonBlaster50
Посмотреть сообщение
HAHA GOT LIKE 7 ERRORS FIXED!


I got a few errors left:

Код:
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(17524) : warning 219: local variable "i" shadows a variable at a preceding level
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(28028) : warning 217: loose indentation
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(28073) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(28073) : warning 215: expression has no effect
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(28073) : error 001: expected token: ";", but found "if"
C:\Documents and Settings\Wouter\Bureaublad\KAM - Map Editor\penls.pwn(28177) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)