Help mee Please Brother.
#1

Hello i create this and look i add just this
PHP код:
     if(randomid == INVALID_PLAYER_ID || !IsPlayerConnected(randomid))
    {
    new 
onlineids[MAX_PLAYERS]; // to store all online playerids
    
new playersonline// to store the amount of current online players
    
new pname1[16]; // to store the chosen player's name
    
for(new i=0i<MAX_PLAYERSi++) // loop through max amount of players (hopefully redefined from default!)
    
{
        if(
IsPlayerConnected(i)) // check to see if current id in the loop is connected
        
{
            
onlineids[playersonline] = i// store the current id into the onlineids variable
            
playersonline++; // increase the playersonline by 1
        
}
        else
        {
        
//print("id is not connected.");
        //SetTimer("BonusPlayer", 60*1000, 0);
        
}
    }
    
randmoney random(50000 1000) + 1000;
    
//GivePlayerMoney(playerid,randmoney);
    
randomid onlineids[random(playersonline)];
    
GetPlayerName(randomidpname1sizeof(pname1));
    new 
str[200];
    
format(strsizeof(str),"{FF8C00}BONUS: {00B9FF}%s (%d) {FFFFFF}Has Been Selected As Bonus Player. Kill Him To Get {73FF00}$%d"pname1randomidrandmoney);
    
SendClientMessageToAll(-1str);
    
GameTextForAll("~w~ New Bonus Player.",30003);
    } 
I dont have error but when map start dont get the bonus.

PHP код:
function StartMap()
{
    
//ClearChat();
    
foreach(Player,i)
    {
        
SetCameraBehindPlayer(i);
        
ClearAnimations(i);
        
HumanSetup(i);
        
SpawnPlayer(i);
        
CurePlayer(i);
        
SetPlayerDrunkLevel(i,0);
        
DisablePlayerCheckpoint(i);
        
pInfo[i][Boxes] = 2;
        
pInfo[i][BoxesAdvanced] = 10;
        
pInfo[i][SkinChanges] = 2;
        
pInfo[i][ArmourChanges] = 2;
        
pInfo[i][pVipBoxes] = 35;
        
pInfo[i][pLadders] = 2;
        
pInfo[i][pFakeKills] = 0;
        
pInfo[i][pAmmoBoxes] = 10;
        
pInfo[i][pKillsIn1Map] = 0;
        
pInfo[i][C4] = 4;
        
pInfo[i][pTrapMasterTrap] = 1;
        
pInfo[i][pScientistCure] = 1;
        
pInfo[i][pDoctorShield] = 1;
        
pInfo[i][pMapsPlayed]++;
        
TextDrawHideForPlayer(iServerIntroOne[i]);
        
TextDrawHideForPlayer(iServerIntroTwo[i]);
        
DestroyPickup(meatDrops[i]);
        
DestroyPickup(ammoDrops[i]);
        
DestroyObject(DocShield);
        
DestroyObject(Trap);
        
TogglePlayerControllable(i,1);
    }
    
time MAX_MAPTIME;
    
SetWeather(Map[Weather]);
    
SetWorldTime(Map[Time]);
    
UpdateMapName();
/*    SendClientMessageToAll(-1,""chat""COL_LGREEN" [Clear]"COL_WHITE" Chat Cleared "COL_YELLOW"[Reason: Next Map]");
    SendClientMessageToAll(-1,""chat""COL_RED" [Info]"COL_WHITE" These maps are created by Iffet Mappers");*/
    
    
SetTimer("RandomZombie",1000,false);
    
gateobj CreateObject(Map[GateID],Map[GateX],Map[GateY],Map[GateZ],Map[GaterX],Map[GaterY],Map[GaterZ],500.0);
    
mapvar SetTimer("OnMapUpdate",MAX_MAPUPDATE_TIME,true);
    
balvar SetTimer("OnMapBalance",MAX_BALANCERUPDATE_TIME,true);
    
     if(
randomid == INVALID_PLAYER_ID || !IsPlayerConnected(randomid))
    {
    new 
onlineids[MAX_PLAYERS]; // to store all online playerids
    
new playersonline// to store the amount of current online players
    
new pname1[16]; // to store the chosen player's name
    
for(new i=0i<MAX_PLAYERSi++) // loop through max amount of players (hopefully redefined from default!)
    
{
        if(
IsPlayerConnected(i)) // check to see if current id in the loop is connected
        
{
            
onlineids[playersonline] = i// store the current id into the onlineids variable
            
playersonline++; // increase the playersonline by 1
        
}
        else
        {
        
//print("id is not connected.");
        //SetTimer("BonusPlayer", 60*1000, 0);
        
}
    }
    
randmoney random(50000 1000) + 1000;
    
//GivePlayerMoney(playerid,randmoney);
    
randomid onlineids[random(playersonline)];
    
GetPlayerName(randomidpname1sizeof(pname1));
    new 
str[200];
    
format(strsizeof(str),"{FF8C00}BONUS: {00B9FF}%s (%d) {FFFFFF}Has Been Selected As Bonus Player. Kill Him To Get {73FF00}$%d"pname1randomidrandmoney);
    
SendClientMessageToAll(-1str);
    
GameTextForAll("~w~ New Bonus Player.",30003);
    }
    return 
1;

Reply
#2

AnyOne ?
Reply
#3

Why is "GivePlayerMoney" commented out? It won't give you the money if its not enabled.

Change
Код:
    //GivePlayerMoney(playerid,randmoney);
to
Код:
    GivePlayerMoney(playerid,randmoney);
Reply
#4

I dont want it -.-. He dont show meee nothing.
Reply
#5

There IS a difference between the two lines of code. The first has // in front of GivePlayerMoney, and the second does NOT.
Reply
#6

pawn Код:
if(randomid == INVALID_PLAYER_ID || !IsPlayerConnected(randomid))
    {
    new onlineids[MAX_PLAYERS]; // to store all online playerids
    new playersonline; // to store the amount of current online players
    new pname1[16]; // to store the chosen player's name
    for(new i=0; i<MAX_PLAYERS; i++) // loop through max amount of players (hopefully redefined from default!)
    {
        if(IsPlayerConnected(i)) // check to see if current id in the loop is connected
        {
            onlineids[playersonline] = i; // store the current id into the onlineids variable
            playersonline++; // increase the playersonline by 1
        }
        else
        {
        print("id is not connected.");
        SetTimer("BonusPlayer", 60*1000, 0);
        }
    }
    randmoney = random(50000 - 1000) + 1000;
    GivePlayerMoney(playerid,randmoney);
    randomid = onlineids[random(playersonline)];
    GetPlayerName(randomid, pname1, sizeof(pname1));
    new str[200];
    format(str, sizeof(str),"{FF8C00}BONUS: {00B9FF}%s (%d) {FFFFFF}Has Been Selected As Bonus Player. Kill Him To Get {73FF00}$%d", pname1, randomid, randmoney);
    SendClientMessageToAll(-1, str);
    GameTextForAll("~w~ New Bonus Player.",3000, 3);
    }
pawn Код:
function StartMap()
{
    //ClearChat();
    foreach(Player,i)
    {
        SetCameraBehindPlayer(i);
        ClearAnimations(i);
        HumanSetup(i);
        SpawnPlayer(i);
        CurePlayer(i);
        SetPlayerDrunkLevel(i,0);
        DisablePlayerCheckpoint(i);
        pInfo[i][Boxes] = 2;
        pInfo[i][BoxesAdvanced] = 10;
        pInfo[i][SkinChanges] = 2;
        pInfo[i][ArmourChanges] = 2;
        pInfo[i][pVipBoxes] = 35;
        pInfo[i][pLadders] = 2;
        pInfo[i][pFakeKills] = 0;
        pInfo[i][pAmmoBoxes] = 10;
        pInfo[i][pKillsIn1Map] = 0;
        pInfo[i][C4] = 4;
        pInfo[i][pTrapMasterTrap] = 1;
        pInfo[i][pScientistCure] = 1;
        pInfo[i][pDoctorShield] = 1;
        pInfo[i][pMapsPlayed]++;
        TextDrawHideForPlayer(i, ServerIntroOne[i]);
        TextDrawHideForPlayer(i, ServerIntroTwo[i]);
        DestroyPickup(meatDrops[i]);
        DestroyPickup(ammoDrops[i]);
        DestroyObject(DocShield);
        DestroyObject(Trap);
        TogglePlayerControllable(i,1);
    }

    time = MAX_MAPTIME;

    SetWeather(Map[Weather]);
    SetWorldTime(Map[Time]);
    UpdateMapName();
/*    SendClientMessageToAll(-1,""chat""COL_LGREEN" [Clear]"COL_WHITE" Chat Cleared "COL_YELLOW"[Reason: Next Map]");
    SendClientMessageToAll(-1,""chat""COL_RED" [Info]"COL_WHITE" These maps are created by Iffet Mappers");*/


    SetTimer("RandomZombie",1000,false);
    gateobj = CreateObject(Map[GateID],Map[GateX],Map[GateY],Map[GateZ],Map[GaterX],Map[GaterY],Map[GaterZ],500.0);
    mapvar = SetTimer("OnMapUpdate",MAX_MAPUPDATE_TIME,true);
    balvar = SetTimer("OnMapBalance",MAX_BALANCERUPDATE_TIME,true);

     if(randomid == INVALID_PLAYER_ID || !IsPlayerConnected(randomid))
    {
    new onlineids[MAX_PLAYERS]; // to store all online playerids
    new playersonline; // to store the amount of current online players
    new pname1[16]; // to store the chosen player's name
    for(new i=0; i<MAX_PLAYERS; i++) // loop through max amount of players (hopefully redefined from default!)
    {
        if(IsPlayerConnected(i)) // check to see if current id in the loop is connected
        {
            onlineids[playersonline] = i; // store the current id into the onlineids variable
            playersonline++; // increase the playersonline by 1
        }
        else
        {
        print("id is not connected.");
        SetTimer("BonusPlayer", 60*1000, 0);
        }
    }
    randmoney = random(50000 - 1000) + 1000;
    GivePlayerMoney(playerid,randmoney);
    randomid = onlineids[random(playersonline)];
    GetPlayerName(randomid, pname1, sizeof(pname1));
    new str[200];
    format(str, sizeof(str),"{FF8C00}BONUS: {00B9FF}%s (%d) {FFFFFF}Has Been Selected As Bonus Player. Kill Him To Get {73FF00}$%d", pname1, randomid, randmoney);
    SendClientMessageToAll(-1, str);
    GameTextForAll("~w~ New Bonus Player.",3000, 3);
    }
    return 1;
}
+rep if worked
Reply
#7

Not work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)