SA-MP Forums Archive
needhelp /safedrugs and /safemats - 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: needhelp /safedrugs and /safemats (/showthread.php?tid=199248)



needhelp /safedrugs and /safemats - jamal1992 - 14.12.2010

Helooo !!!

I need help !!

I want to make a safe system for gang members, this means to make a pickup in orders /put materials or drugs and /take materials or drugs, this can only be used by gang members, and when a member writes / stats to show him "safedrugs" and "safemats" and the amount that holds in the safe
Please Help me!
Respect!
Good luck!


Re: needhelp /safedrugs and /safemats - blackwave - 14.12.2010

Just a example:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == 1)
    {
        if(gPlayer[playerid] != gang) return 0; // If the player isn't from the gang named "gang", nothing happens
        else return true;
    }
    return 1;
}



Re: needhelp /safedrugs and /safemats - jamal1992 - 14.12.2010

THX Man, know to create the pickup,but i don`t know to create the command and all necessary !!!!
Give me the script command and all necessarry !!!!


Re: needhelp /safedrugs and /safemats - blackwave - 14.12.2010

You can do it by many ways. One of them and most used is:
pawn Код:
new gTeam[MAX_PLAYERS];  // Top of script, for defined which team is the player from
          #define SX 1
pawn Код:
On the callback OnPlayerClassRequest
          if(classid == 0) return gPlayer[playerid]=SX;

And according commands, and classes, you can add/define the teams/restrictions

This is just a basic example. If the player choose the class ID 0 (CJ CHARACTER), his team will be the defined team "SX".


Re: needhelp /safedrugs and /safemats - jamal1992 - 14.12.2010

Man i don`t understand...
so how do you get in that safe drugs through the command / rescue to put drugs and to show him / stats "safedrugs [ammount]


Re: needhelp /safedrugs and /safemats - blackwave - 14.12.2010

pawn Код:
new DRUGS[MAX_PLAYERS]; // Script top
pawn Код:
new COUNT = 0; // Script top
pawn Код:
if(strcmp("/rescue",cmdtext,true,10) == 0)
{
   new string[128];
   DRUGS[playerid] = amount;
   format(string,sizeof(string),"%d",DRUGS);
   GameTextForPlayer(playerid, string, 5000, 5);
}
pawn Код:
new tmp[128];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp("/pickup",cmdtext,true,10) == 0)
{
  tmp = strtok(cmdtext, idx);
   new id; id = strval(tmp);
   if(!strval(tmp)) return false;
   count++ = id;
}
Edit: I dont know certain how do it...
Here's a tutorial of strtok: https://sampwiki.blast.hk/wiki/Tutorial_of_strtok

More help at: www.wiki.sa-mp.com


Re: needhelp /safedrugs and /safemats - jamal1992 - 15.12.2010

help Me with the script .... i don`t know how make !!!
Please Help !!!


Re: needhelp /safedrugs and /safemats - jamal1992 - 15.12.2010

nobody help me ?


Re: needhelp /safedrugs and /safemats - jamal1992 - 15.12.2010

i need help !!!


Re: needhelp /safedrugs and /safemats - jamal1992 - 15.12.2010

help mee pls