How do I assign IDs? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How do I assign IDs? (
/showthread.php?tid=640879)
How do I assign IDs? -
AmarPlayer - 08.09.2017
Hello, I need help with assigning IDs, for example I made a command for making apartments, but I want to assign IDs to them so that all this works every time the gamemode is ran, and later I can make a command to delete them, here's my code:
Код:
CMD:napravistan(playerid, params[], help)
{
JeliLogovan
if(PlayerInfo[playerid][pAdmin] < 6) return NematePravo
if(AdminDuznost[playerid] == 0) return NisteAD
else
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
Create3DTextLabel("{FFDF2D}| STAN |\n{ffdf2d}| CIJENA: $50.000 |\n{ffdf2d}| {ffffff}Da kupite ovaj stan kucajte {ffdf2d}/kupistan |", -1, x, y, z, 30.0, 0, 0);
CreatePickup(19523, 2, x, y, z, 0);
}
return 1;
}
If more info needed, ask me in the comments.
EDIT: I figured out how I should do this, i need to make a txt file so every time I do the command it writes the ID in that file, and OnGameModeInit i just have to load that all, but how to make it all work?