Jump to content
  • 0

nu imi apare checkpoint-ul


InceMan

Question

salut,  cand dau startstunt  imi apare mesajul cu acel stunt ca incepe dar problema este alta nu imi apare un checkpoint, sa vad unde se afla acel checkpoint

public SetRaceCheckpointAll() {
    for (new i = 0, j = GetPlayerPoolSize(); i <= j; i++) {
      	if(stunton[i] == 1) { // Cei care sunt la event vor primi toti acelasi CP.
          	new randoms = random(sizeof(stuntnrg));
        	SetPlayerCheckpoint(i, stuntnrg[randoms][0], stuntnrg[randoms][1], stuntnrg[randoms][2], 1.0);
 
                                                   
                                                   
/////////// am facut un SetTimerEx dar nu imi apare acel checkpoint SetPlayerCheckpoint(i, stuntnrg[randoms][0], stuntnrg[randoms][1], stuntnrg[randoms][2], 1.0);
CMD:startstunt(playerid, params[])
{
    
	if (PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
	SetTimerEx("SetRaceCheckpointAll", 1000, false, "i");
	SendClientMessage(playerid, COLOR_YELLOW2, "Stunt-ul a pornit.");
	return ( true ) ;                                                
}	                                                 

 

Edited by Geani

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

20 answers to this question

Recommended Posts

  • 0

Salut, prin asta apelezi functia SetRaceCheckpointAll cu un parametru pe care el nu il apeleaza.

SetTimerEx("SetRaceCheckpointAll", 1000, false, "i");

Funtia corecta care trebuie apelata:

SetTimer("SetRaceCheckpointAll", 1000, false);

 

Link to comment
Share on other sites

  • 0
Acum 11 ore, WopsS a spus:

Poți să faci un debug (adică sa afișezi ce conține stuntnrg[randoms][0], stuntnrg[randoms][1], stuntnrg[randoms][2])?

am facut uite ce imi da  stunt1 (08@HPX`hp÷ ]Xe€óÔĹ    jjé‘wL
Z“±É(H9˝o ě8„Đh´
[06:07:55] stunt1 (08@HPX`hp÷ ]Xe€óÔĹ    jjé‘wL
Z“±É(H9˝o ě8„Đh´

Acum 9 ore, BuNiCu-RP a spus:

Salut, prin asta apelezi functia SetRaceCheckpointAll cu un parametru pe care el nu il apeleaza.


SetTimerEx("SetRaceCheckpointAll", 1000, false, "i");

Funtia corecta care trebuie apelata:


SetTimer("SetRaceCheckpointAll", 1000, false);

 

nici asa nu imi merge 

nu imi trece de acel if(stunton == 1) {

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
Acum 7 ore, BuNiCu-RP a spus:

#debug 


printf("%f", stuntnrg[randoms][0]);
printf("%f", stuntnrg[randoms][1]);
printf("%f", stuntnrg[randoms][2]);

 

AM pus si asa si nu imi da nicio valoare in log

 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
Acum 7 minute, WopsS a spus:

Afișează și randoms și arată-ne cum ai declarat stuntnrg.

numai atata am new randoms = random(sizeof(stuntnrg));

doar la stuntnrg am 

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}
};

 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
Acum 7 ore, WopsS a spus:

Mă refer să afișezi variabila randoms cum ai făcut și cu stuntnrg[randoms][0], stuntnrg[randoms][1], stuntnrg[randoms][2].

nu imi da nicio valoare in log 

public SetRaceCheckpointAll() {
    for (new i = 0, j = GetPlayerPoolSize(); i <= j; i++) {
      	if(stunton[i] == 1) { // Cei care sunt la event vor primi toti acelasi CP.
          	new randoms = random(sizeof(stuntnrg));
        	SetPlayerCheckpoint(i, stuntnrg[randoms][0], stuntnrg[randoms][1], stuntnrg[randoms][2], 1.0);
          	SetPlayerMapIcon(i, 53, stuntnrg[randoms][0], stuntnrg[randoms][1], stuntnrg[randoms][2], 53, MAPICON_GLOBAL_CHECKPOINT);
          	pickup_event = CreatePickup(1274, 2, stuntnrg[randoms][0], stuntnrg[randoms][1], stuntnrg[randoms][2], GetPlayerVirtualWorld(i));
		    printf("stunt1%f", stuntnrg[randoms][0]);
            printf("stunt2%f", stuntnrg[randoms][1]);
            printf("stunt3%f", stuntnrg[randoms][2]);
            printf("stunt4%f", randoms);		
        }
    }

  	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;
}

 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
Acum 3 minute, WopsS a spus:

Poate nu trece de verificarea stunton == 1.

uite daca asi face asa 

for (new i = 0, j = GetPlayerPoolSize(); i <= j; i++) {
      	//if(stunton[i] == 1) { // Cei care sunt la event vor primi toti acelasi CP.
		    stunton[i] = 1;

le da checkpoint dar le da la toti playeri diferite checkpoint-uri

practin nu trece de acel if si un =

Edited by Geani

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
Acum 28 minute, WopsS a spus:

Daca faci asa nu mai are rost sa setezi acea variabila pe 1. Mai bine cauta in gamemode unde o setezi, poate e o comanda. Imi aduc aminte de o problema similara, parca tot tu ai postat-o.

numi dau seama de unde ar putea sa fie problema

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
Acum 26 minute, WopsS a spus:

Incearca sa stergi verificarea si vezi daca-ti merge.

am scos ala imi apare acum dar acum nu mai pot lua checkpointu-ul

si in legatura despre log imi da asa  acuma

[02:10:03] stunt1,  2188.973388
[02:10:03] stunt2, 2236.543212
[02:10:03] stunt3, 24.933000
[02:10:03] stunt4, 0.000000
[02:10:03] stunt5, 0.000000
 

Edited by Geani

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
Acum 6 minute, WopsS a spus:

Inseamna ca trebuie sa-ti mearga acum, nu?

imi merge dar nu il pot lua cu acen nrg checkpoint-ul

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0
Acum 5 ore, WopsS a spus:

Uita-te la OnPlayerEnterCheckpoint sau cum era callback-ul, dar in continuare iti sugerez  sa te uiti print gamemode dupa stunton.

sa fie din cauza asta ca lam definit asa stunton[MAX_PLAYERS] si nu lam pus cevade genul stunton= 0;  ? 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

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

sa fie din cauza asta ca lam definit asa stunton[MAX_PLAYERS] si nu lam pus cevade genul stunton= 0;  ? 

Stunton [MAX_PLAYERS] este un vector, iar stunton este o variabila. Daca definesti doar ca stunton toti jucatorii il vor avea pe 0 respectiv 1 cand e eventul pornit chiar daca acestia nu vor sa participe. Nu inteleg ce e asa greu sa faci un sistem de random stunts, licrezi la el de vro 2 luni. In timpu asta faci un gm de la 0...

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.