01.08.2014, 12:18
Hello i create this and look i add just this
I dont have error but when map start dont get the bonus.
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=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);
}
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(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;
}