[Tutorial] Count Object on GM
#1

I will teach guys how to count the objects we have in our server.

-First we create a variable that stores the number of objects

pawn Код:
new OBJECT;
-Then we will call a function to move the objects to be counted CreateObject before

pawn Код:
forward ObjectCount(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, Float:DRAW_DISTANCE);
-Now create the function

pawn Код:
public ObjectCount(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, Float:DRAW_DISTANCE)
{
    OBJETC++;
    return CreateObject(modelid, X, Y, Z, rX, rY, rZ, DRAW_DISTANCE);
}
-Now we can see in a Dialogue

pawn Код:
new str[3];
format(str, sizeof(3), "%i", OBJECT);
ShowPlayerDialog(playerid, ID, DIALOG_STYLE_MSGBOX, "Object", str, "Ok", " ");
End xD.
Reply


Messages In This Thread
Count Object on GM - by LuisGraph - 22.02.2012, 16:53
Re: Count Object on GM - by Luis- - 22.02.2012, 17:03
Respuesta: Count Object on GM - by LuisGraph - 22.02.2012, 17:16
Re: Count Object on GM - by Vince - 22.02.2012, 17:24
Respuesta: Count Object on GM - by LuisGraph - 22.02.2012, 17:40

Forum Jump:


Users browsing this thread: 2 Guest(s)