SA-MP Forums Archive
Hello everyone HElp mee [++REP] - 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: Hello everyone HElp mee [++REP] (/showthread.php?tid=560810)



Hello everyone HElp mee [++REP] - arlindi - 30.01.2015

Hello everyone I want to create something but i cant do it!!!
Can you do it for mee .. Please

I want to create A Chose Player System
Ok its the example

The player if is team human can be chosen by the server randomly with random Ammount money from 1000-3000

IF player go in evac give money to The chosen playet
But if player got killed by anyone give money to the killerid
Else if player died He isnt more choosen

Thnx for understand please help mee

I will rep you <3


Re: Hello everyone HElp mee [++REP] - CalvinC - 30.01.2015

Quote:

IF player go in evac give money to The chosen playet
But if player got killed by anyone give money to the killerid
Else if player died He isnt more choosen

First, make a variable to store who is the chosen.
pawn Код:
new Chosen[MAX_PLAYERS];
Then set a repeating timer of like 1 second or something under OnGameModeInit, that checks if the player is in range of the point ("Evac") with IsPlayerInRangeOfPoint.
Then check if Chosen is set to 0, if so, set it to 1 and give him the money.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(Chosen[playerid] == 1)
    {
        GivePlayerMoney(playerid, - AMOUNT); // Remove if you don't want to take the money from the chosen.
        GivePlayerMoney(killerid, AMOUNT);
    }
    return 1;
}
Quote:

The player if is team human can be chosen by the server randomly with random Ammount money from 1000-3000

You can use Random for this.


Re: Hello everyone HElp mee [++REP] - arlindi - 30.01.2015

I know but idk how to use random with id and with ammout ... Please do it for mee Please


Re: Hello everyone HElp mee [++REP] - CalvinC - 30.01.2015

Use a switch.
Here's an example that will choose randomly between giving 1000, 2000 or 3000.
pawn Код:
switch(random(2))
{
    case 0: GivePlayerMoney(playerid, 1000);
    case 1: GivePlayerMoney(playerid, 2000);
    case 2: GivePlayerMoney(playerid, 3000);
}



Re: Hello everyone HElp mee [++REP] - arlindi - 30.01.2015

NOt this i want ramdomly

From 1000 To 3000 Example 1534 :UNDERSTAND PLEASE:

Also crate for mee and the RandomPlayerID


Re: Hello everyone HElp mee [++REP] - CalvinC - 30.01.2015

Haven't tested it, but this might work:
pawn Код:
GivePlayerMoney(playerid, 1000 + random(3000 - 1000));



Re: Hello everyone HElp mee [++REP] - BeesSi - 30.01.2015

Trying to help him in a foreign language ( Albanian )

Qka po don me lyp shqipe qe t'ndihmoj , sqaroje mir qka po don


Re: Hello everyone HElp mee [++REP] - arlindi - 30.01.2015

Dua te krijoj Tek lojtaret TEAM_HUMAN qe te zgjidhet automatikish nga server random playerid dhe money
Dhe ne qofte se shon ne checkpoint OnPlayerCheckpoint jepi Parate playerid ndersa kur vrihet nga killerid i jep parate Killerid-se
Du qe ai Parate qe zgjidhen Random te jen 1000-3000 Money

A me kuptove ? Tashi ?


Re: Hello everyone HElp mee [++REP] - CalvinC - 30.01.2015

Quote:
Originally Posted by arlindi
Посмотреть сообщение
Dua te krijoj Tek lojtaret TEAM_HUMAN qe te zgjidhet automatikish nga server random playerid dhe money
Dhe ne qofte se shon ne checkpoint OnPlayerCheckpoint jepi Parate playerid ndersa kur vrihet nga killerid i jep parate Killerid-se
Du qe ai Parate qe zgjidhen Random te jen 1000-3000 Money

A me kuptove ? Tashi ?
Write english in the main section of the forum, otherwise go into the language sections.


Re: Hello everyone HElp mee [++REP] - arlindi - 30.01.2015

Ohh am sorry !!

But help mee please I want to create it Please do it for mee