SA-MP Forums Archive
Drug System? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Drug System? (/showthread.php?tid=87927)



Drug System? - Abernethy - 23.07.2009

Hey guys, I want to learn to know how to make well, I can't really say how but I'll give an example.
You have a team score okay, 0 to 0 (displayed in a Textdraw), team A & team B. Say, Team A score 1 point, how to I make it go up by one, or go down by one. This is just an example not what I really want to happen, I was just askin'..


New Question, put it this way. Can anybody help to create a Drug System? I want to know how.


Re: Drug System? - sggassasin - 23.07.2009

y dont you do something like this


new PlayerHasseeds[MAX_PLAYERS];

new PlayerHasplanted[MAX_PLAYERS];

new Playerhasedrugs[MAX_PLAYERS];//make a veriable to see if player hase drugs


if(!strcmp(cmdtext, "/buydseeds", true))
//if statment to see if player is in the area to buy seeds
PlayerHasseeds[playerid] = 1;

else

SendClientMessage(playerid,0xFFFF00AA,"your not near a store to buy seeds");

if(!strcmp(cmdtext, "/plantseeds", true))
GetPlayerPos(playerid, x, y, z);
//creat pickup at player location
PlayerHasplanted[playerid] = 1;
PlayerHasseeds[playerid] = 0;


esle


SendClientMessage(playerid,0xFFFF00AA,"your dont have Seeds");

if(!strcmp(cmdtext, "/takedrug", true))
//player action !
// use the player hase drug veriable
Playerhasedrugs[playerid] = 0;

else

return 1;
}

if(!strcmp(cmdtext, "/digupdrug", true))
//use setplayerto point to see if player is where he planted the drugs
//action
Playerhasedrugs[playerid] = 1;
PlayerHasplanted[playerid] = 0;
else

SendClientMessage(playerid,0xFFFF00AA,"your not near Drugs");

return 1;
{




ok idk if that would work it just a gusse but if it dose post the thing back up


Re: Drug System? - Abernethy - 23.07.2009

I know how to do that, I want it eg.
pawn Код:
new Drugs[MAX_PLAYERS];

// EG. Smuggling
new RandDrugs = random(950) + 50;
Drugs[playerid] = RandDrugs;

// /inventory, using a string that i cbf to script.

SendClientMessage(playerid, COLOR_BLUE, "Drugs: s%"); // Something like that.. that can tell how much of it you've.