SA-MP Forums Archive
Mask System ID's - 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: Mask System ID's (/showthread.php?tid=579331)



Mask System ID's - dionisak0s - 26.06.2015

I am currently working on a mask system which generates random ID's when you use it, it's quiet similar to LSRP's but I am in need of something like /pay 33121_2311 or whatever so the player X may pay the player Y without the player X revealing his ID.


Re: Mask System ID's - Prokill911 - 26.06.2015

Pretty easily done...

Make a stock function..

In that stock function....

1, Is the player masked
2, What is there mask ID [ How are you storing the mask ID ]
3, Return the players ID


Re: Mask System ID's - dionisak0s - 26.06.2015

Already done the first two things, added the thing to work on almost every command, but now I want to make the system even better and I can't figure out how to return player ID's when the correct Mask ID is used on a command, if I type in-game /pay 123213_123 it will return invalid player id.


Re: Mask System ID's - Prokill911 - 26.06.2015

If you are checking if the person is masked.
And you have a method of storing each mask per player.

Simply make a stock function...

example
/pay 123_123 1

Once typed.
IT would go to the function...
.
IsMasked(playerid) {

Make a foreach statement..
Loop through all connected players
if the player is connected {
Do they have a mask on
If they have a mask on {
Is there mask ID == to the input ID of /pay
if it is == to the input ID of the mask



SIMPLY

return i


Once returned i;
It will return back to the /pay command

i == target


Re: Mask System ID's - dionisak0s - 26.06.2015

pawn Код:
IsMasked(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConneted(i))
        {
            if(IsPlayerMasked[playerid])
            {
                if(GetPlayerMaskID(playerid) ==
No idea what to do then lol


Re: Mask System ID's - Prokill911 - 26.06.2015

Quote:
Originally Posted by dionisak0s
Посмотреть сообщение
pawn Код:
IsMasked(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConneted(i))
        {
            if(IsPlayerMasked[playerid])
            {
                if(GetPlayerMaskID(playerid) ==
No idea what to do then lol
PHP код:
IsMasked(target)
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConneted(i))
        {
            if(
IsPlayerMasked[i])
            {
                if(
GetPlayerMaskID(target)) {
                         return 
target;
                    } 
that's an example


Re: Mask System ID's - dionisak0s - 26.06.2015

It shows an error, which is error 033: array must be indexed (variable "GetPlayerMaskID")


Re: Mask System ID's - rappy93 - 26.06.2015

GetPlayerMaskID should be a function for the above script to work.


Re: Mask System ID's - Prokill911 - 26.06.2015

Quote:
Originally Posted by rappy93
Посмотреть сообщение
GetPlayerMaskID should be a function for the above script to work.
^ Ignore him..

PHP код:
IsMasked(target)
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConneted(i))
        {
            if(
IsPlayerMasked[i])
            {
                    new 
MaskID GetPlayerMaskID(i);
                if(
MaskID == target) {
                         return 
i;
                    } 



Re: Mask System ID's - dionisak0s - 26.06.2015

GetPlayerMaskID is a stock for me which checks if a player is wearing a mask and returns Stranger %d_%d, or else his name. If I go in-game the message should be like this once I type /mask Stranger 123456_12, actually it generates a random number whenever a player is using the command.

Edit 2: The code above doesn't works.