DestryDynamicObject problem
#1

nevermind
Reply
#2

pawn Код:
if (newkeys & KEY_CROUCH)
{
    if(IsValidDynamicObject(Lsobject[117]) && IsPlayerInRangeOfPoint(playerid,2.0,1386.78, -1016.10, 26.01))
    {
        switch(random(6))
        {
            case 0:
            {
                GivePlayerMoney(playerid, 10);
                SendClientMessage(playerid, WHITE, "[!] 10$.");
            }
            case 1:
            {
                GivePlayerMoney(playerid, 15);
                SendClientMessage(playerid, WHITE, "[!] 15$.");
            }
            case 2:
            {
                GivePlayerMoney(playerid, 20);
                SendClientMessage(playerid, WHITE, "[!] 20$.");
            }
            case 3:
            {
                GivePlayerMoney(playerid, 30);
                SendClientMessage(playerid, WHITE, "[!] 30$.");
            }
            case 4:
            {
                GivePlayerMoney(playerid, 25);
                SendClientMessage(playerid, WHITE, "[!] 25$.");
            }
            case 5:
            {
                GivePlayerMoney(playerid, 45);
                SendClientMessage(playerid, WHITE, "[!] 45$.");
            }
            case 6:
            {
                GivePlayerMoney(playerid, 35);
                SendClientMessage(playerid, WHITE, "[!] 35$.");
            }
            DestroyMoneyObject();
        }
    }
}
pawn Код:
stock DestroyMoneyObject()
{
    DestroyDynamicObject(Lsobject[117]);
    estroyDynamic3DTextLabel(Lslabel[117]);
    return 1;
}
Reply
#3

not workin...
Reply
#4

use this it work i tested

pawn Код:
new Lslabel;
new Lsobject;
pawn Код:
//under ongamemodeinit
Lslabel = CreateDynamic3DTextLabel("moneyyyyyyy", 0xFFFFFFAA, 1386.78, -1016.10, 26.0,2.5);
Lsobject = CreateDynamicObject(1550, 1386.78, -1016.10, 26.01,   0.00, 0.00, 0.00);

pawn Код:
if (newkeys & KEY_CROUCH)
{
    if(IsPlayerInRangeOfPoint(playerid, 2.5, 1386.78, -1016.10, 26.01))
    {
        switch(random(6))
        {
            case 0:
            {
                GivePlayerMoney(playerid, 10);
                SendClientMessage(playerid, WHITE, "[!] 10$.");
            }
            case 1:
            {
                GivePlayerMoney(playerid, 15);
                SendClientMessage(playerid, WHITE, "[!] 15$.");
            }
            case 2:
            {
                GivePlayerMoney(playerid, 20);
                SendClientMessage(playerid, WHITE, "[!] 20$.");
            }
            case 3:
            {
                GivePlayerMoney(playerid, 30);
                SendClientMessage(playerid, WHITE, "[!] 30$.");
            }
            case 4:
            {
                GivePlayerMoney(playerid, 25);
                SendClientMessage(playerid, WHITE, "[!] 25$.");
            }
            case 5:
            {
                GivePlayerMoney(playerid, 45);
                SendClientMessage(playerid, WHITE, "[!] 45$.");
            }
            case 6:
            {
                GivePlayerMoney(playerid, 35);
                SendClientMessage(playerid, WHITE, "[!] 35$.");
            }
            DestroyMoneyObject();
        }
    }
}
pawn Код:
stock DestroyMoneyObject()
{
    DestroyDynamicObject(Lsobject);
    estroyDynamic3DTextLabel(Lslabel);
    return 1;
}
Reply
#5

ok, but i got few thousands objects... and i'm not gonna create variable and stock for each object
Reply
#6

so, anyone?
Reply
#7

pawn Код:
stock DestroyMoneyObject()
{
    DestroyDynamicObject(Lsobject);
    DestroyDynamic3DTextLabel(Lslabel);
    return 1;
}
You forgot a D there
Reply
#8

Quote:
Originally Posted by shadowdog
Посмотреть сообщение
pawn Код:
stock DestroyMoneyObject()
{
    DestroyDynamicObject(Lsobject);
    DestroyDynamic3DTextLabel(Lslabel);
    return 1;
}
You forgot a D there
this isn't solution... i can't use stocks! (srr for bad eng)
Reply
#9

Look :

Код HTML:
#define MAX_OBJE 405 
static Stuff1[MAX_OBJE];
Код HTML:
Stuff1[16]=CreateDynamicObject(1550, -2574.06, 1151.98, 54.80,   0.00, 0.00, 0.00);
Код HTML:
if (newkeys & KEY_CROUCH)
    {
if(IsValidDynamicObject(Stuff1[16]) && IsPlayerInRangeOfPoint(playerid,2.0,-2574.06, 1151.98, 54.80))
        {
            GivePlayerMoney(playerid, 1);
            DestroyDynamicObject(Stuff1[16]);

}
Ant this works! Whats the different between this one and the "Lsobject"!!! I DONT UNDERSTAND
Reply
#10

pawn Код:
if (newkeys & KEY_CROUCH)
{
    if(IsValidDynamicObject(Lsobject[117]) && IsPlayerInRangeOfPoint(playerid,2.0,1386.78, -1016.10, 26.01))
    {
        switch(random(6))
        {
            case 0:
            {
                GivePlayerMoney(playerid, 10);
                SendClientMessage(playerid, WHITE, "[!] 10$.");
            }
            case 1:
            {
                GivePlayerMoney(playerid, 15);
                SendClientMessage(playerid, WHITE, "[!] 15$.");
            }
            case 2:
            {
                GivePlayerMoney(playerid, 20);
                SendClientMessage(playerid, WHITE, "[!] 20$.");
            }
            case 3:
            {
                GivePlayerMoney(playerid, 30);
                SendClientMessage(playerid, WHITE, "[!] 30$.");
            }
            case 4:
            {
                GivePlayerMoney(playerid, 25);
                SendClientMessage(playerid, WHITE, "[!] 25$.");
            }
            case 5:
            {
                GivePlayerMoney(playerid, 45);
                SendClientMessage(playerid, WHITE, "[!] 45$.");
            }
            case 6:
            {
                GivePlayerMoney(playerid, 35);
                SendClientMessage(playerid, WHITE, "[!] 35$.");
            }
        }
                DestroyMoneyObject();
    }
}
pawn Код:
stock DestroyMoneyObject()
{
    DestroyDynamicObject(Lsobject[117]);
    DestroyDynamic3DTextLabel(Lslabel[117]);
    return 1;
}
u were using
pawn Код:
DestroyMoneyObject();
this in a switch u would have got an error or warning while compiling if not then re download the sa-mp package
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)