"Stack/heap collision (insufficient stack size)"
#1

EDIT: I fixed it at the top of script with this:

PHP код:
#pragma dynamic 500000 
Hi again, i know... someone know how to fix this?



"Stack/heap collision (insufficient stack size)"


Код:
[debug] #0 ???????? in public cmd_furniture ()
[debug] #1 native CallLocalFunction () [004743b0] from samp-server.exe
[debug] #2 ???????? in public OnPlayerCommandText ()
#define MAX_FURNITURE (2000)

PHP код:
CMD:furniture(playerid, params[])
{
    static
        
houseid = -1;
    if ((
houseid = House_Inside(playerid)) != -1 && House_IsOwner(playerid, houseid))
    {
        new
            
count = 0,
            
string[MAX_FURNITURE * 32];
        for (new 
i = 0; i != MAX_FURNITURE; i ++) if (count < MAX_HOUSE_FURNITURE && FurnitureData[i][furnitureExists] && FurnitureData[i][furnitureHouse] == houseid) {
            
ListedFurniture[playerid][count++] = i;
            
format(string, sizeof(string), "%s%s (%.2f meters)\n", string, FurnitureData[i][furnitureName], GetPlayerDistanceFromPoint(playerid, FurnitureData[i][furniturePos][0], FurnitureData[i][furniturePos][1], FurnitureData[i][furniturePos][2]));
        }
        if (
count) {
            
Dialog_Show(playerid, ListedFurniture, DIALOG_STYLE_LIST, "Listed Furniture", string, "Select", "Anuleaza");
         }
         else 
SendErrorMessage(playerid, "This house doesn't have any furniture spawned.");
    }
    else 
SendErrorMessage(playerid, "You are not in range of your house interior.");
    return 
1;
} 
And

Quote:

[debug] #0 ?? in public OnPlayerText ()
[debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[debug] Stack pointer (STK) is 0x88A3B4, heap pointer (HEA) is 0x88BB3C
[debug] AMX backtrace:

and when i use CMD:call .. :S

[SPOILER]
PHP код:
CMD:call(playerid, params[])
{
    if (!
Inventory_HasItem(playerid, "Cellphone"))
        return 
SendErrorMessage(playerid, "You don't have a cellphone on you.");
    if (
PlayerData[playerid][pPhoneOff])
        return 
SendErrorMessage(playerid, "Your phone must be powered on.");
    if (
PlayerData[playerid][pHospital] != -1 || PlayerData[playerid][pCuffed] || PlayerData[playerid][pInjured] || !IsPlayerSpawned(playerid))
        return 
SendErrorMessage(playerid, "You can't use this command now.");
    static
        
targetid,
        
number;
    if (
sscanf(params, "d", number))
        return 
SendSyntaxMessage(playerid, "/call [phone number] (1222 for taxi, 911 for emergency, 222 for news, 223 for billboards)");
    if (!
number)
        return 
SendErrorMessage(playerid, "The specified phone number is not in service.");
    if (
number == 911)
    {
        
PlayerData[playerid][pEmergency] = 1;
        
PlayerPlaySound(playerid, 3600, 0.0, 0.0, 0.0);
        
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s takes out their cellphone and places a call.", ReturnName(playerid, 0));
        
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[OPERATOR]:{FFFFFF} Which service do you require: \"police\" or \"medics\"?");
    }
    else if (
number == 1222)
    {
        
PlayerData[playerid][pTaxiCalled] = 1;
        
PlayerPlaySound(playerid, 3600, 0.0, 0.0, 0.0);
        
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s takes out their cellphone and places a call.", ReturnName(playerid, 0));
        
SendClientMessage(playerid, COLOR_YELLOW, "[OPERATOR]:{FFFFFF} The taxi department has been notified of your call.");
        
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s has hung up their cellphone.", ReturnName(playerid, 0));
        
SendJobMessage(3, COLOR_YELLOW, "** %s is requesting a taxi at %s (use /acceptcall to accept).", ReturnName(playerid, 0), GetPlayerLocation(playerid));
    }
    else if (
number == 222)
    {
        
PlayerData[playerid][pPlaceAd] = 1;
        
PlayerPlaySound(playerid, 3600, 0.0, 0.0, 0.0);
        
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s takes out their cellphone and places a call.", ReturnName(playerid, 0));
        if (
PlayerData[playerid][pPlayingHours] < 4) {
            
SendClientMessage(playerid, COLOR_CYAN, "[OPERATOR]:{FFFFFF} Sorry, you must play 4 hours to place an advertisement.");
            
cmd_hangup(playerid, "\1");
        }
        else if (
PlayerData[playerid][pAdTime] < 1) {
            
SendClientMessage(playerid, COLOR_CYAN, "[OPERATOR]:{FFFFFF} Please say \"yes\" if you wish to advertise for $500.");
        }
        else {
            
SendClientMessage(playerid, COLOR_CYAN, "[OPERATOR]:{FFFFFF} You've already advertised in the last 2 minutes. Please try again later.");
            
cmd_hangup(playerid, "\1");
        }
    }
    else if (
number == 223)
    {
        
PlayerPlaySound(playerid, 3600, 0.0, 0.0, 0.0);
        
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s takes out their cellphone and places a call.", ReturnName(playerid, 0));
        if (
PlayerData[playerid][pPlayingHours] < 4) {
            
SendClientMessage(playerid, COLOR_CYAN, "[OPERATOR]:{FFFFFF} Sorry, you must play 4 hours to rent a billboard.");
            
cmd_hangup(playerid, "\1");
        }
        
SendClientMessageEx(playerid, COLOR_YELLOW, "[TELEFON]:{FFFFFF} Hello, this is the Los Santos Billboard Agency, please listen to the following choices!");
        
ViewBillboards(playerid);
    }
    else if ((
targetid = GetNumberOwner(number)) != INVALID_PLAYER_ID)
    {
        if (
targetid == playerid)
            return 
SendErrorMessage(playerid, "You can't call yourself!");
        if (
PlayerData[targetid][pPhoneOff])
            return 
SendErrorMessage(playerid, "The recipient has their cellphone powered off.");
        
PlayerData[targetid][pIncomingCall] = 1;
        
PlayerData[playerid][pIncomingCall] = 1;
        
PlayerData[targetid][pCallLine] = playerid;
        
PlayerData[playerid][pCallLine] = targetid;
        
SendClientMessageEx(playerid, COLOR_YELLOW, "[TELEFON]:{FFFFFF} Se realizeaza conexiunea cu numarul #%d, va rugam asteptati...", number);
        
SendClientMessageEx(targetid, COLOR_YELLOW, "[TELEFON]:{FFFFFF} Apel primit de la #%d (scrie \"/raspunde\" pentru a raspunde la telefon.).", PlayerData[playerid][pPhone]);
        
PlayerPlaySound(playerid, 3600, 0.0, 0.0, 0.0);
        
PlayerPlaySoundEx(targetid, 23000);
        
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s takes out their cellphone and places a call.", ReturnName(playerid, 0));
    }
    else
    {
        
SendErrorMessage(playerid, "Numarul de telefon specificat nu se afla disponibil, revino mai tarziu.");
    }
    return 
1;
} 
[/SPOILER]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)