[SUGGESTION] Inventory System
#2

You will need to create a TextDraw and update the text, just like this example:

https://sampwiki.blast.hk/wiki/TextDrawCreate
https://sampwiki.blast.hk/wiki/TextDrawDestroy
https://sampwiki.blast.hk/wiki/TextDrawSetString

pawn Код:
#include <a_samp>
#include <zcmd>

new Text:invTD[MAX_PLAYERS], var[MAX_PLAYERS][3], invTimer[MAX_PLAYERS];

public OnPlayerConnect(playerid){
    invTD[playerid] = TextDrawCreate(240.0,580.0,"Inventory\n");
    UpdateInvTD(playerid);
    TextDrawShowForPlayer(playerid, invTD[playerid]);
   
    invTimer[playerid] = SetTimerEx("UpdateInvTD", 3000, true, "i", playerid);
    return 1;
}

public OnPlayerDisconnect(playerid, reason){
    TextDrawHideForPlayer(playerid, invTD[playerid]);
    TextDrawDestroy(invTD[playerid]);
   
    KillTimer(invTimer[playerid]);
    return 1;
}

forward UpdateInvTD(playerid);
public UpdateInvTD(playerid){
    new longStr[300];
    if(var[playerid][1] == 1) //change to your vars
    {
        format(longStr, sizeof(longStr), "%sVar 1\n");
    }
   
    if(var[playerid][2] == 2) //change to your vars
    {
        format(longStr, sizeof(longStr), "%sVar 2");
    }
   
    TextDrawSetString(invTD[playerid], longStr);

    return 1;
}
Reply


Messages In This Thread
[SUGGESTION] Inventory System - by DavideFatman - 27.04.2016, 00:58
Re: [SUGGESTION] Inventory System - by RedCounty - 27.04.2016, 09:12

Forum Jump:


Users browsing this thread: 1 Guest(s)