Jump to content
  • 0

Problema NRG-500


InceMan

Question

salut am incercat deceva timp sa creiez un stunt care sa fie la fiecare 30 min automat ei imi da Checkpoint-urile e totul in regula ideia este ca atunci cand te duci la el sa il ei nu il pot lua acumasi a doua problema cum as-i putea sa fac ca acel stunt sa porneasca la tot serverul nu sa le deie la fiecare playeri Checkpoint diferite

poze http://imgur.com/a/JotRE

la  OnPlayerEnterCheckpoint am asta

if(IsANRG(vid))
    {
        if(STUNTV[playerid] == 1)
        {
            new Name = GetPlayerName(playerid);
            new randmoney = 3500 + random(90000);

            format(string,sizeof(string),"{CF165D}%s A castigat STUNT-ul, acesta a castigat %d$.",FormatNumber(randmoney));
            SendClientMessageToAll( COLOR_GREEN, string);
            DisablePlayerCheckpoint(playerid);
            RemovePlayerMapIcon(playerid, 1274);
            DestroyPickup(pickup_event);
            SendClientMessage(playerid, COLOR_YELLOW, "STUNT-ul este in perioada de probe  Nu este finalizat.");
            GivePlayerCash(playerid, randmoney);
            Update(playerid, pCashx);

        }
    }

 

Edited by Geani

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

19 answers to this question

Recommended Posts

  • 0

Salut! Incearca sa pleci de la idee asta de baza, adaugi tu codurile acolo care le mai vrei. Eu am pus-o sub forma de comanda deoarece nu stau sa tot verific cat este ora:

public OnPlayerEnterCheckpoint(playerid)
{
	if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 522)
	{
	    if(stunton[playerid] == 1)
	    {
	        //new playername[25];
	        //GetPlayerName(playerid, playername, sizeof(playername));
	        //new randmoney = 3500 + random(90000);
	        DisablePlayerCheckpoint(playerid);
          	stunton[playerid] = 0;
	        RemovePlayerMapIcon(playerid, 1274);
			DestroyPickup(pickup_event);
			//format(string,sizeof(string),"{CF165D}%s A castigat STUNT-ul, acesta a castigat %d$.", playername, randmoney);
			//SendClientMessageToAll( -1, string);
			//GivePlayerCash(playerid, randmoney);
	        //Update(playerid, pCashx);
			SendClientMessage(playerid, -1, "Un nou stunt incepe la 3 minute.");
	        SendClientMessage(playerid, -1, "STUNT-ul este in perioada de probe  Nu este finalizat.");
	        SendClientMessage(playerid, -1, "Ai gasit-o pe Elodia!");
	    }
	}
	return 1;
}


CMD:estetimpul(playerid, params[])
{
	SetTimerEx("bestandy", 1000, false, "i", playerid);
	return ( true ) ;
}

forward bestandy(playerid);
public bestandy(playerid)
{
    for(new i = 0; i<MAX_PLAYERS; i++)
    {
	    if(IsPlayerConnected(i))
	    {
	        new randoms = random(sizeof(stuntnrg));
	        {
	            SetPlayerCheckpoint(i, stuntnrg[randoms][0], stuntnrg[randoms][1], stuntnrg[randoms][2], 1.0);
	            SetPlayerMapIcon(playerid, 53, stuntnrg[randoms][0], stuntnrg[randoms][1], stuntnrg[randoms][2], 53, MAPICON_GLOBAL);
	            pickup_event = CreatePickup(1274, 2, stuntnrg[randoms][0], stuntnrg[randoms][1], stuntnrg[randoms][2], GetPlayerVirtualWorld(playerid));
	            SendClientMessageToAll(-1, "A new stunting event has just started. It  has been marked on your Map with a Black&White Race Flag Get there first and you'II win.");
			    stunton[playerid] = 1;
		    }
	    }
	}
	return ( true ) ;
}

 

Edited by andy47
Link to comment
Share on other sites

  • 0
Acum 31 minute, WopsS a spus:

Cum creezi acel checkpoint?

am aici tot ce este facut de mine si nu stiu ce ar ma-i trebui sai fac acum,  acum ii da bani doar la un singur jucator daca intra 10 playeri le da la fiecare ca incepe acel stunt http://pastebin.com/UY5788M3

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
1 oră în urmă, WopsS a spus:

Nu inteleg ce vrei sa spui.

deci daca sunt 10 playeri conectati pe server apare de 10 ori mesajul asta  SendClientMessageToAll(-1, "A new stunting event has just started. It  has been marked on your Map with a Black&White Race Flag Get there first and you'II win.");

si daca un player ajunge la stunt si il castiga restul playeri-lor nu mai poate sa eie stunt-ul, daca intra in checkpoint ii apare hack teleport 

http://imgur.com/a/eL7GB
http://imgur.com/a/uvyyy

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
7 minutes ago, Geani said:

deci daca sunt 10 playeri conectati pe server apare de 10 ori mesajul asta  SendClientMessageToAll(-1, "A new stunting event has just started. It  has been marked on your Map with a Black&White Race Flag Get there first and you'II win.");

si daca un player ajunge la stunt si il castiga restul playeri-lor nu mai poate sa eie stunt-ul, daca intra in checkpoint ii apare hack teleport 

http://imgur.com/a/eL7GB
http://imgur.com/a/uvyyy

probabil este de la un loop. da-ne un cod mai complex nu te putem ajuta cu cat ne-ai dat.

Retras

Link to comment
Share on other sites

  • 0
Chiar acum, Tud0r. a spus:

probabil este de la un loop. da-ne un cod mai complex nu te putem ajuta cu cat ne-ai dat.

pai mai mult de atata nu am doar atata am putut sa fac de unul singur si vad ca nu merge cum ar trebui

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
On ‎1‎/‎29‎/‎2017 at 10:11 PM, Geani said:

da-ti topic clossed daca nu doreste nimeni sa ma ajute, sau sunteti fuduli !

new Float:STUNTNRG[10][3] = {
{1138.5302,-1803.2852,33.6527},
{940.9116,-1428.5436,30.7764},
{603.3672,-1627.6234,28.0839},
{601.2933,-1549.7220,34.8223},
{1774.5129,893.7565,26.9023},
{2101.7854,1504.8895,31.2062},
{2166.8149,1679.5735,20.4190},
{2188.9734,2236.5432,24.9330},
{-2052.5098,-51.8506,47.3118},
{-2364.0139,598.5428,47.1264}
};

function IsANRG(vehicleid)
{
    if(vehicleid == 522)
    return 1;
}
function STUNT(playerid)
{
    
    foreach (new i : Player)
    {
        if(IsPlayerConnected(i))
        {
            new STUNTTT = random(sizeof(STUNTNRG));
            SetPlayerCheckpoint(i, STUNTNRG[STUNTTT][0], STUNTNRG[STUNTTT][1], STUNTNRG[STUNTTT][2], 1.0);
            SetPlayerMapIcon(playerid, 53, STUNTNRG[STUNTTT][0], STUNTNRG[STUNTTT][1], STUNTNRG[STUNTTT][2], 53, MAPICON_GLOBAL);
            
            pickup_event = CreatePickup(1274, 2, STUNTNRG[STUNTTT][0], STUNTNRG[STUNTTT][1], STUNTNRG[STUNTTT][2], GetPlayerVirtualWorld(playerid));
            //SetPlayerCheckpoint(i, x, y, z, rz); // rz = raza cercului
            STUNTV[playerid] = 1;
        }
    }
    SendClientMessageToAll(-1, "A new stunting event has just started. It  has been marked on your Map with a Black&White Race Flag Get there first and you'II win.");
    return 1;
}

// OnPlayerEnterCheckpoint am asa
new vid = GetVehicleModel(GetPlayerVehicleID(playerid));
if(IsANRG(vid))
{
    if(STUNTV[playerid] == 1)
    {
        new playername[25];
        GetPlayerName(playerid, playername, sizeof(playername));
        new randmoney = 3500 + random(90000);
        DisablePlayerCheckpoint(playerid);
        RemovePlayerMapIcon(playerid, 1274);
		DestroyPickup(pickup_event);
		format(string,sizeof(string),"{CF165D}%s A castigat STUNT-ul, acesta a castigat %d$.", playername, randmoney);
		SendClientMessageToAll( COLOR_GREEN, string);
		GivePlayerCash(playerid, randmoney);
        Update(playerid, pCashx);
		SendClientMessage(playerid, COLOR_YELLOW, "Un nou stunt incepe la 3 minute.");
        SendClientMessage(playerid, COLOR_YELLOW, "STUNT-ul este in perioada de probe  Nu este finalizat.");
    }
}

Incearca asa.

  • Upvote 1

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
1 oră în urmă, DaEdRiC-FoX a spus:

new Float:STUNTNRG[10][3] = {
{1138.5302,-1803.2852,33.6527},
{940.9116,-1428.5436,30.7764},
{603.3672,-1627.6234,28.0839},
{601.2933,-1549.7220,34.8223},
{1774.5129,893.7565,26.9023},
{2101.7854,1504.8895,31.2062},
{2166.8149,1679.5735,20.4190},
{2188.9734,2236.5432,24.9330},
{-2052.5098,-51.8506,47.3118},
{-2364.0139,598.5428,47.1264}
};

function IsANRG(vehicleid)
{
    if(vehicleid == 522)
    return 1;
}
function STUNT(playerid)
{
    
    foreach (new i : Player)
    {
        if(IsPlayerConnected(i))
        {
            new STUNTTT = random(sizeof(STUNTNRG));
            SetPlayerCheckpoint(i, STUNTNRG[STUNTTT][0], STUNTNRG[STUNTTT][1], STUNTNRG[STUNTTT][2], 1.0);
            SetPlayerMapIcon(playerid, 53, STUNTNRG[STUNTTT][0], STUNTNRG[STUNTTT][1], STUNTNRG[STUNTTT][2], 53, MAPICON_GLOBAL);
            
            pickup_event = CreatePickup(1274, 2, STUNTNRG[STUNTTT][0], STUNTNRG[STUNTTT][1], STUNTNRG[STUNTTT][2], GetPlayerVirtualWorld(playerid));
            //SetPlayerCheckpoint(i, x, y, z, rz); // rz = raza cercului
            STUNTV[playerid] = 1;
        }
    }
    SendClientMessageToAll(-1, "A new stunting event has just started. It  has been marked on your Map with a Black&White Race Flag Get there first and you'II win.");
    return 1;
}

// OnPlayerEnterCheckpoint am asa
new vid = GetVehicleModel(GetPlayerVehicleID(playerid));
if(IsANRG(vid))
{
    if(STUNTV[playerid] == 1)
    {
        new playername[25];
        GetPlayerName(playerid, playername, sizeof(playername));
        new randmoney = 3500 + random(90000);
        DisablePlayerCheckpoint(playerid);
        RemovePlayerMapIcon(playerid, 1274);
		DestroyPickup(pickup_event);
		format(string,sizeof(string),"{CF165D}%s A castigat STUNT-ul, acesta a castigat %d$.", playername, randmoney);
		SendClientMessageToAll( COLOR_GREEN, string);
		GivePlayerCash(playerid, randmoney);
        Update(playerid, pCashx);
		SendClientMessage(playerid, COLOR_YELLOW, "Un nou stunt incepe la 3 minute.");
        SendClientMessage(playerid, COLOR_YELLOW, "STUNT-ul este in perioada de probe  Nu este finalizat.");
    }
}

Incearca asa.

acum nu imi ma-i arata mesajul ala 

 SendClientMessageToAll(-1, "A new stunting event has just started. It  has been marked on your Map with a Black&White Race Flag Get there first and you'II win.");

cand sunt Ma-i multi playeri conectati

dar acuma nu mai pot lua checkpoint-ul cu nrg-500 +  ca la fiecare players ii da checkoint diferit ar trebui sa fie un checkpoin la toti playeri

imi da si warning-ul asta (2321) : warning 209: function "IsANRG" should return a value

Edited by Geani

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
4 hours ago, Geani said:

deci daca sunt 10 playeri conectati pe server apare de 10 ori mesajul asta  SendClientMessageToAll(-1, "A new stunting event has just started. It  has been marked on your Map with a Black&White Race Flag Get there first and you'II win.");

si daca un player ajunge la stunt si il castiga restul playeri-lor nu mai poate sa eie stunt-ul, daca intra in checkpoint ii apare hack teleport 

http://imgur.com/a/eL7GB
http://imgur.com/a/uvyyy

Scoate acel SendClientMessageToAll din acel foreach sau poti sa il inlocuiesti cu SendCientMessage si asa nu o sa mai apara la fiecare jucator de 10 ori. Daca vrei sa il castige toti scoate

RemovePlayerMapIcon(playerid, 1274);
DestroyPickup(pickup_event);

din codul tau.

  • Upvote 1
Link to comment
Share on other sites

  • 0
Acum 12 ore, WopsS a spus:

Scoate acel SendClientMessageToAll din acel foreach sau poti sa il inlocuiesti cu SendCientMessage si asa nu o sa mai apara la fiecare jucator de 10 ori. Daca vrei sa il castige toti scoate


RemovePlayerMapIcon(playerid, 1274);
DestroyPickup(pickup_event);

din codul tau.

am incercat si asa cum ai spus tu tot nu merge doar un singur player poate sa eie acel premiu chear daca incepe alt stunt alti playeri inafara de mine nu mai poata sa eie acel checkpoint

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
1 oră în urmă, WopsS a spus:

Pune alea la loc, acum văd că tu transmiți printr-un parametru id-ul unui jucător, de ce?  STUNTV[playerid] = 1, nu trebuia să fie i în loc de playerid?

te referi la 

[playerid]
STUNTV[playerid] = 1;

 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.