#1

PHP код:
//OnPlayerPickUpPickUp
    
new houseid = -1;
    new 
IDD IsPlayerNearHouse(playerid);
    for(new 
iddidd<MAX_HOUSESidd++)
    {
        if(
HouseInfo[idd][HousePickup] == pickupid)
        {
            
houseid idd;
            break;
        }
    }
    if(
houseid != -1)
    {
        new 
str[128];
        
format(str128"~y~Price: ~w~$%d~n~~y~Owner: ~w~%s~n~~y~House ID: ~w~%d"HouseInfo[houseid][HouseValue], HouseInfo[houseid][HouseOwner], IDD);
        
GameTextForPlayer(playeridstr60003);
        new 
ownerid GetPlayerID(HouseInfo[IDD][HouseOwner]);
        if(
ownerid == playerid)
        {
              
SetPlayerHealth(ownerid,100.0);
            
SetPlayerArmour(ownerid,100.0);
        }
    } 
Код:
[17:40:42] [debug] Run time error 4: "Array index out of bounds"
[17:40:42] [debug]  Attempted to read/write array element at negative index -1
[17:40:42] [debug] AMX backtrace:
[17:40:42] [debug] #0 00153c60 in public OnPlayerPickUpPickup (playerid=0, pickupid=1961) at D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn:10825
[17:40:45] Saved 1982 Properties!
[17:40:51] [debug] Run time error 4: "Array index out of bounds"
[17:40:51] [debug]  Attempted to read/write array element at negative index -1
[17:40:51] [debug] AMX backtrace:
[17:40:51] [debug] #0 00153c60 in public OnPlayerPickUpPickup (playerid=0, pickupid=1961) at D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn:10825
Reply
#2

Код:
//OnPlayerPickUpPickUp 
    new houseid = -1; 
    new IDD = IsPlayerNearHouse(playerid); //is -1
    for(new idd; idd<MAX_HOUSES; idd++) 
    { 
        if(HouseInfo[idd][HousePickup] == pickupid) 
        { 
            houseid = idd; 
            break; 
        } 
    } 
    if(houseid != -1 && IDD != -1) 
    { 
        new str[128]; 
        format(str, 128, "~y~Price: ~w~$%d~n~~y~Owner: ~w~%s~n~~y~House ID: ~w~%d", HouseInfo[houseid][HouseValue], HouseInfo[houseid][HouseOwner], IDD); 
        GameTextForPlayer(playerid, str, 6000, 3); 
        new ownerid = GetPlayerID(HouseInfo[IDD][HouseOwner]); 
        if(ownerid == playerid) 
        { 
              SetPlayerHealth(ownerid,100.0); 
            SetPlayerArmour(ownerid,100.0); 
        } 
    }
Reply
#3

Change
Код:
format(str, 128, "~y~Price: ~w~$%d~n~~y~Owner: ~w~%s~n~~y~House ID: ~w~%d", HouseInfo[houseid][HouseValue], HouseInfo[houseid][HouseOwner], IDD);
for
Код:
format(str, 128, "~y~Price: ~w~$%d~n~~y~Owner: ~w~%s~n~~y~House ID: ~w~%d", HouseInfo[houseid][HouseValue], HouseInfo[houseid][HouseOwner], houseid);
Reply
#4

Same things
Reply
#5

show us "ZoneX.pwn:10825" (Line 10825 of ZoneX.pwn)
Its in the error messsage, if this number change, then give the line given in the new error.
Reply
#6

PHP код:
stock GeZxYInFrontOfPlayer(playerid, &Float:x, &Float:yFloat:distance)
{
    new 
Float:a;
    
GetPlayerPos(playeridxya);
    
GetPlayerFacingAngle(playerida);
    if (
GetPlayerVehicleID(playerid)) {GetVehicleZAngle(GetPlayerVehicleID(playerid), a);}
    
+= (distance floatsin(-adegrees));
    
+= (distance floatcos(-adegrees));

Reply
#7

Quote:
Originally Posted by Loinal
Посмотреть сообщение
PHP код:
stock GeZxYInFrontOfPlayer(playerid, &Float:x, &Float:yFloat:distance)
{
    new 
Float:a;
    
GetPlayerPos(playeridxya);
    
GetPlayerFacingAngle(playerida);
    if (
GetPlayerVehicleID(playerid)) {GetVehicleZAngle(GetPlayerVehicleID(playerid), a);}
    
+= (distance floatsin(-adegrees));
    
+= (distance floatcos(-adegrees));

thats 9 line, I want that one line with the error...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)