Help with this ! ! !
#1

Hey guys im trying to make a cool tree thingy (dont ask why) but im trying to make a function that returns all current trees, ive made a /createtree and stored all the variables in it,like Tree owner and tree id,but i just cant get this function to work:

pawn Код:
stock GetTrees(playerid)
{
    new str[128];
    SendClientMessage(playerid, ORANGE, "Current Trees:");
    for(new j; j<MAX_TREES; j++)
    {
        format(str,128, "Name: %s(ID:%d), Leader: %s",TreeInfo[playerid][Name],TreeID,TreeInfo[playerid][Leader]);
        SendClientMessage(playerid, ORANGE, str);
    }
}
it just spams me with that
Reply
#2

NVM <8chars>
Reply
#3

As what have you defined 'MAX_TREES'? Also, check if the tree ID exists. It's probably what's spamming it (You're sending data from all variables, including the 'trees' that aren't used)
Reply
#4

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
As what have you defined 'MAX_TREES'? Also, check if the tree ID exists. It's probably what's spamming it (You're sending data from all variables, including the 'trees' that aren't used)
NVM <8chars>

I failed
Reply
#5

okay that stops it from spamming it but the function is suppose to return all the trees, when i type it in game it just shows the current tree which im owning when ive created multiple trees, how would i go about doing it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)