Help me with these errors please.
#1

../gamemodes/Build.pwn(12940) : error 029: invalid expression, assumed zero
../gamemodes/Build.pwn(12940) : error 017: undefined symbol "i"
../gamemodes/Build.pwn(12941) : warning 209: function "CreateLoot" should return a value
../gamemodes/Build.pwn(12942) : error 010: invalid function or declaration
../gamemodes/Build.pwn(12950) : error 010: invalid function or declaration

PHP код:
public CreateLoot(itemid1itemid2itemid3itemid4Float:XFloat:YFloat:Zworldidintid)
{
    new 
found 0foundid 0str[128];
    for(new 
0MAX_PLAYERSi++)
    {
        if(
LootInfo[i][lUsed] == && found == 0)
        {
            
found++;
            
foundid=i;
        }
    }
    if(
found == 0) return true;
    
LootInfo[foundid][lUsed]=1;
    
LootInfo[foundid][lText]=CreateDynamic3DTextLabel(str0x33AA33FFXYZ-0.725.0INVALID_PLAYER_IDINVALID_VEHICLE_ID1worldidintid, -150.0);
    if(
itemid1 21 && itemid1 35)
    {
        
LootInfo[foundid][lObject] = CreateDynamicObject(PrintIid(itemid1), XY180.00.00.0worldid);
    }
    if(
itemid1 >= 100 && itemid1 <= 150)
    {
        
LootInfo[foundid][lObject] = CreateDynamicObject(2037XY10.00.00.0worldid);
    }
    if(
itemid1 == 403)
    {
        
LootInfo[foundid][lObject] = CreateDynamicObject(1650XY10.00.00.0worldid);
    }
    if(
itemid1 == 406)
    {
        
LootInfo[foundid][lObject] = CreateDynamicObject(1210XY10.00.00.0worldid);
    }
    if(
itemid1 >= 500 && itemid1 <= 550) = ShowPlayerDialog(iDIALOG_PACKAGEDIALOG_STYLE_LISTstring"Shoe Box\nTrash Bag\nLunch Bag\nRubbish Box\nBurger Box\nDefault Drug Package""Drop""Cancel");
    }
    
LootInfo[foundid][lTime]=60;
    
LootInfo[foundid][lItem][0]=itemid1;
    
LootInfo[foundid][lItem][1]=itemid2;
    
LootInfo[foundid][lItem][2]=itemid3;
    
LootInfo[foundid][lItem][3]=itemid4;
    
LootInfo[foundid][lX]=X;
    
LootInfo[foundid][lY]=Y;
    
LootInfo[foundid][lZ]=Z;
    return 
true;

I want a dialog to show up here, been playing around with it for 4 hours but can't seem to get success...

PHP код:
if(itemid1 >= 500 && itemid1 <= 550) = ShowPlayerDialog(iDIALOG_PACKAGEDIALOG_STYLE_LISTstring"Shoe Box\nTrash Bag\nLunch Bag\nRubbish Box\nBurger Box\nDefault Drug Package""Drop""Cancel"); 
Reply
#2

Replace "i" with "foundid" instead. Remove the equal sign before the ShowPlayerDialog and delete the }-bracket after the ShowPlayerDialog.

Honestly I haven't read through it fully (which means that the code will perhaps not work as intended) but you have to look at these small mistakes yourself, they get easier to spot by time but just read what the errors say and you should be fine. Cheers
Reply
#3

Thanks for the reply, I'll try it out.
Reply
#4

It's compiling, but crashing when I drop a drug.

It should work like this, if I drop itemid 500-550 (ID's for the drugs) a dialog should come up, it shouldn't just drop a object like the other itemid's do, in that dialog I can select how the dropped object should look like, that would be a Shoe Box etc. to conceal the drug and make it not too obvious when dropping it off somewhere.

I had it working before but now the whole dialog thing messed up.
Reply
#5

Try this.

PHP код:
public CreateLoot(itemid1itemid2itemid3itemid4Float:XFloat:YFloat:Zworldidintid

    new 
found 0foundid 0str[128]; 
    for(new 
0MAX_PLAYERSi++) 
    { 
        if(
LootInfo[i][lUsed] == && found == 0
        { 
            
found++; 
            
foundid=i
        } 
    } 
    if(
found == 0) return true
    
LootInfo[foundid][lUsed]=1
    
LootInfo[foundid][lText]=CreateDynamic3DTextLabel(str0x33AA33FFXYZ-0.725.0INVALID_PLAYER_IDINVALID_VEHICLE_ID1worldidintid, -150.0); 
    if(
itemid1 21 && itemid1 35
    { 
        
LootInfo[foundid][lObject] = CreateDynamicObject(PrintIid(itemid1), XY180.00.00.0worldid); 
    } 
    if(
itemid1 >= 100 && itemid1 <= 150
    { 
        
LootInfo[foundid][lObject] = CreateDynamicObject(2037XY10.00.00.0worldid); 
    } 
    if(
itemid1 == 403
    { 
        
LootInfo[foundid][lObject] = CreateDynamicObject(1650XY10.00.00.0worldid); 
    } 
    if(
itemid1 == 406
    { 
        
LootInfo[foundid][lObject] = CreateDynamicObject(1210XY10.00.00.0worldid); 
    } 
    if(
itemid1 >= 500 && itemid1 <= 550){
    
ShowPlayerDialog(iDIALOG_PACKAGEDIALOG_STYLE_LISTstring"Shoe Box\nTrash Bag\nLunch Bag\nRubbish Box\nBurger Box\nDefault Drug Package""Drop""Cancel");}
    
LootInfo[foundid][lTime]=60
    
LootInfo[foundid][lItem][0]=itemid1
    
LootInfo[foundid][lItem][1]=itemid2
    
LootInfo[foundid][lItem][2]=itemid3
    
LootInfo[foundid][lItem][3]=itemid4
    
LootInfo[foundid][lX]=X
    
LootInfo[foundid][lY]=Y
    
LootInfo[foundid][lZ]=Z
    return 
true

P.S: Don't forget to do what Hansrugter said in the script i gave you!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)