[POMOC]Random rasporedjivanje igraca

Započeo TrakkaMadafakaâ„¢, Septembar 08, 2012, 20:29:01 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:Privatna
Detaljan opis problema:Jednostavno nemog da nastimam random rasporedjivanje igraca na eventu ...evom dole komandom se pridruzujes Eventu i eno dole za rasporedjivanje igraca na Crveni i Plavi tim ..
Dio skripte:

if (strcmp("/forest", cmdtext, true, 10) == 0)
{
if(Togforest == 1)
{
    SetPlayerInterior(playerid, 0);
    TogglePlayerControllable(playerid,0);

    switch(random(1))
    {
    case 1:Crveni(playerid);
case 1:Plavi(playerid);
    }
    }

    return 1;
    }
    return 0;
}


Ukoliko bude potreban jos neki dio te filterskripte postavit cu..
Neke slike/video za lakse dobivanje pomoci(neobavezno): //

Refreš

Molim da mi neko sto brze pomogne ! Hvala unaprijed !


Ma znm to .. to je nesto sto sam pokusavao al' opet ne uspijeva ...

Probaj ovako

if (strcmp("/forest", cmdtext, true, 10) == 0)
{
if(Togforest == 1)
{
    SetPlayerInterior(playerid, 0);
    TogglePlayerControllable(playerid,0);
    new rand = random(2);
    switch(rand)
    {
    case 1 : Crveni(playerid);
case 2 : Plavi(playerid);
}
    }
    return true;
}
Izvinjavam se na svim glupostima i ako sam nekome napisao nesto lose, neko drugi je koristio moj profil!
__________________________________________
https://bk.gta.world - GTA World Balkan - RAGEMP


Citat: [MTA]Almedin poslato Septembar 09, 2012, 11:30:59 PRE PODNE
26 Errors  >:( :D :-[

Nije na komandi koju sam ti ja dao,prebroj i sam zagrade pa ces videti.
Izvinjavam se na svim glupostima i ako sam nekome napisao nesto lose, neko drugi je koristio moj profil!
__________________________________________
https://bk.gta.world - GTA World Balkan - RAGEMP

pa jbg nisam ni ja nista drugo mijenjo , samo moju komandu izbriso' i tu stavio

Daj ova dva public/stock-a ili sta ti je vec:

Crveni(playerid)
Plavi(playerid)
Izvinjavam se na svim glupostima i ako sam nekome napisao nesto lose, neko drugi je koristio moj profil!
__________________________________________
https://bk.gta.world - GTA World Balkan - RAGEMP

Evo cijela filterscripta :

#include <a_samp>

new Togforest;



#define TEAM_HIT_COLOR 0xFFFFFF00
#define COLOR_ORANGE 0xFF7700AA
#define BOJA_BILA 0xFFFFFFAA
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_LIGHTBLUE 0x33CCFFAA

#if defined FILTERSCRIPT



public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("     Forest Filterscript by Antonio     ");
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

#else

main()
{
print("\n----------------------------------");
print("  Forest Filterscript by Antonio    ");
print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
    return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerSpawn(playerid)
{
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerColor(playerid, COLOR_GRAD2);
return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}

public OnPlayerText(playerid, text[])
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/forestoff", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid))
{
for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    Togforest = 0;
}
    }
}
return 1;
}
if(strcmp("/foreston", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid))
{
    Togforest = 1;
    SendClientMessageToAll(COLOR_ORANGE, "Forest: Server je aktivirao Forest DM. Molimo utipkajte /forest da se pridruzite.");

    }
return 1;
}
if(strcmp("/unfall", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid))
{
for(new i=0; i<MAX_PLAYERS; i++)
{
    TogglePlayerControllable(i, 1);
    }
    }
    return 1;
    }
    if (strcmp("/forestcount", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid))
{
Togforest = 0;
SetTimer("forest", 1000, 0);
SetTimer("forest1", 2000, 0);
SetTimer("forest2", 3000, 0);
SetTimer("forest3", 4000, 0);
}
    return 1;
    }
    if (strcmp("/forest", cmdtext, true, 10) == 0)
{
if(Togforest == 1)
{
    SetPlayerInterior(playerid, 0);
    TogglePlayerControllable(playerid,0);
    new rand = random(2);
    switch(rand)
    {
    case 1 : Crveni(playerid);
case 2 : Plavi(playerid);
}
    }
    return true;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}

public OnRconCommand(cmd[])
{
return 1;
}

public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnObjectMoved(objectid)
{
return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}

public OnPlayerExitedMenu(playerid)
{
return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}

public OnPlayerUpdate(playerid)
{
return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
forward forest(playerid);
forward forest1(playerid);
forward forest2(playerid);
forward forest3(playerid);
forward Crveni(playerid);
forward Plavi(playerid);

public forest(playerid)
{
    GameTextForAll("~w~3",2000,3);
    PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
    return 1;
}

public forest1(playerid)
{
    GameTextForAll("~w~2",2000,3);
    PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
    return 1;
}

public forest2(playerid)
{
    GameTextForAll("~w~1",2000,3);
    PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
    return 1;
}

public forest3(playerid)
{
    for(new i=0; i < MAX_PLAYERS; i++)
    {
    GameTextForAll("~r~GO! GO! GO!",3000,3);
    TogglePlayerControllable(i,1);
    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0);
    }
    {
    SendClientMessageToAll(COLOR_ORANGE, "Forest: Server je startao Forest DM event.Krenite u borbu (plavi vs crveni / crveni vs plavi).");
    }
    return 1;
}

public Crveni(playerid)
{
    SetPlayerPos(playerid, -840.5459,-1941.6716,12.4118);
ResetPlayerWeapons(playerid);
SetPlayerColor(playerid, COLOR_LIGHTRED);
SetPlayerSkin(playerid, 161);
GivePlayerWeapon(playerid, 31, 450);
    GivePlayerWeapon(playerid, 24, 450);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
TogglePlayerControllable(playerid,0);
  return 1;
}

public Plavi(playerid)
{
    SetPlayerPos(playerid, -669.2382,-2001.9631,24.7904);
ResetPlayerWeapons(playerid);
SetPlayerColor(playerid, COLOR_LIGHTBLUE);
SetPlayerSkin(playerid, 162);
GivePlayerWeapon(playerid, 31, 450);
    GivePlayerWeapon(playerid, 24, 157);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
TogglePlayerControllable(playerid,0);
  return 1;
}



A evo i slike od Errora: