Someone help me out.
#1

I got this:

pawn Код:
#include <a_samp>

new Float:RandomCheckpoints[][3] =
{
    { x, y, z},
    { x, y, z},
    { x, y, z},
    { x, y, z},
    { x, y, z},
    { x, y, z}

};
new IsMoneyHunting[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
    IsMoneyHunting[playerid] = 0;
    SetPlayerCheckpoint(playerid, x,y,z, 3.0);//I normaly streamer plug
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    GameTextForPlayer(playerid,"~r~money hunt~n~type /start to enter",3000,3);
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    Winner(playerid);
    DisablePlayerRaceCheckpoint(playerid);
    PlayerPlaySound(playerid, 1138, 0.0, 0.0, 10.0);
    IsMoneyHunting[playerid] = 0;
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/start", cmdtext, true, 10) == 0)
    {
        GameTextForPlayer(playerid,"~g~moneyhunt started~n~get to the red marker",3000,3);
        new randcheck = random(sizeof(RandomCheckpoints));
        SetPlayerRaceCheckpoint(playerid,0,RandomCheckpoints[randcheck][0],RandomCheckpoints[randcheck][1],RandomCheckpoints[randcheck][2],0,0,0,8);
        IsMoneyHunting[playerid] = 1;
        return 1;
    }
    return 0;
}
forward Winner(playerid);
public Winner(playerid)
{
     //Blah Blah Blah
     return 1;
}
Its working. But how can i make it so more than 1 player use it at a time.

Peace...
Reply
#2

Is this the correct way ? So all players can use.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/start", cmdtext, true, 10) == 0)
    {
        if(IsMoneyHunting[playerid] == 1) return GameTextForPlayer(playerid,"~r~your already doing the money hunt",3000,3);
        {
            for(new i;i < MAX_PLAYERS; i++)
            {
                GameTextForPlayer(playerid,"~g~moneyhunt started~n~get to the red marker",3000,3);
                new randcheck = random(sizeof(RandomCheckpoints));
                SetPlayerRaceCheckpoint(playerid,0,RandomCheckpoints[randcheck][0],RandomCheckpoints[randcheck][1],RandomCheckpoints[randcheck][2],0,0,0,8);
                IsMoneyHunting[playerid] = 1;
                return 1;
            }
        }
    }
    return 0;
}
Thanks.

Peace...
Reply
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/start", cmdtext, true, 10) == 0)
    {
        if(IsMoneyHunting[playerid] == 1) return GameTextForPlayer(playerid,"~r~your already doing the money hunt",3000,3);
        {
            for(new i;i < MAX_PLAYERS; i++)
            {
                GameTextForPlayer(playerid,"~g~moneyhunt started~n~get to the red marker",3000,3);
                new randcheck = random(sizeof(RandomCheckpoints));
                SetPlayerRaceCheckpoint(playerid,0,RandomCheckpoints[randcheck][0],RandomCheckpoints[randcheck][1],RandomCheckpoints[randcheck][2],0,0,0,8);
                IsMoneyHunting[playerid] = 1;
                return 1;
            }
        }
    }
    return 0;
}
Is wrong, you didn't even use (i) instead of (playerid).
Anyway, it should work for all players in the first script.
Reply
#4

Quote:
Originally Posted by maramizo
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/start", cmdtext, true, 10) == 0)
    {
        if(IsMoneyHunting[playerid] == 1) return GameTextForPlayer(playerid,"~r~your already doing the money hunt",3000,3);
        {
            for(new i;i < MAX_PLAYERS; i++)
            {
                GameTextForPlayer(playerid,"~g~moneyhunt started~n~get to the red marker",3000,3);
                new randcheck = random(sizeof(RandomCheckpoints));
                SetPlayerRaceCheckpoint(playerid,0,RandomCheckpoints[randcheck][0],RandomCheckpoints[randcheck][1],RandomCheckpoints[randcheck][2],0,0,0,8);
                IsMoneyHunting[playerid] = 1;
                return 1;
            }
        }
    }
    return 0;
}
Is wrong, you didn't even use (i) instead of (playerid).
Anyway, it should work for all players in the first script.
Thats why i was asking. With the (i) will it work at the same time, i mean if someone else is already doing the task ?

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/start", cmdtext, true, 10) == 0)
    {
        if(IsMoneyHunting[playerid] == 1) return GameTextForPlayer(playerid,"~r~your already doing the money hunt",3000,3);
        {
            for(new i;i < MAX_PLAYERS; i++)
            {
                GameTextForPlayer(i,"~g~moneyhunt started~n~get to the red marker",3000,3);
                new randcheck = random(sizeof(RandomCheckpoints));
                SetPlayerRaceCheckpoint(i,0,RandomCheckpoints[randcheck][0],RandomCheckpoints[randcheck][1],RandomCheckpoints[randcheck][2],0,0,0,8);
                IsMoneyHunting[i] = 1;
                return 1;
            }
        }
    }
    return 0;
}
Thanks.

Peace...
Reply
#5

Nooooooooo you fucked it up.
That will make everyone in money hunt!
I meant the first script that you posted, what's wrong with it?
Reply
#6

It uses race checkpoints, i thought you can only have 1 at a time in samp.
Or is it one per player ?

Peace...
Reply
#7

It's one per player lol.
Reply
#8

Thanks for the help.

Peace...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)