Problem(error/warning): Ovako Goto sistem je radio Softic i tu moras da prihvatis i da odbijes goto kad ti igrac salje itd.Medjutim to sve radi dialozi stizu al kad npr ja sam id 1 i posaljem goto igracu koji je id 2,3,4 ili neki na gore ono se porta do id 0.Znaci stalno se porta do id 0 moze neko da fix to?
Dio skripte: https://pastebin.com/WBNUCyau
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [ code ]vaš odgovor[ /code ]
Slika/video ingame problema(obavezno ako je ingame problem): link slike
new gotoRequest[MAX_PLAYERS] = -1;
YCMD:goto(playerid, params[], help)
{
if (PlayerInfo[playerid][pRadi] == 1)
return SCM(playerid,-1,"Vas Server | "CRVENA"Radis posao ne mozes da koristis ovu komandu!");
if (!PlayerInfo[playerid][pAdmin] && !PlayerInfo[playerid][pGM] && !PlayerInfo[playerid][pPromoter] && !PlayerInfo[playerid][pVip])
return SCM(playerid, -1,""CRVENA"[PORT] "BELA"Samo Admini - GM i V.I.P!");
new giveplayerid;
if (sscanf(params, "u", giveplayerid))
return SCM(playerid, -1,""ZUTA"PORT Pomoc | "BELA"/goto [ID/Nick]");
if (giveplayerid == INVALID_PLAYER_ID)
return SCM(playerid, -1,""CRVENA"Igrac nije povezan!");
SCM(playerid, -1,""SRWBOJA"[Vas Server]"BELA"Poslali ste zahtjev za teleport, pricekajte malo!");
new buffer[128];
format(buffer, sizeof buffer, ""SRWBOJA"Igrac "BELA"%s vam je poslao zahtev za /goto !:", GetName(playerid));
SPD(giveplayerid, 2115, DSB, "Zahtev za Goto", string, "Prihvati", "Odbij");
SetTimerEx("gotoRequestExpire", 4200, false, "dd", playerid, giveplayerid);
gotoRequest[giveplayerid] = playerid;
return 1;
}
// Timer
forward gotoRequestExpire(playerid, targetid);
public gotoRequestExpire(playerid, targetid) {
gotoRequest[targetid] = -1;
ShowPlayerDialog(targetid, -1, 0, '\0', '\0', '\0', '\0');
SCM(playerid, -1, ""SRWBOJA"[NK:RPG] "BELA"Vas zahtjev za goto je istekao!");
return 1;
}
// Dialog
fDialog(2115)
{
if(response)
{
SCM(playerid, -1, ""SRWBOJA"[NK:RPG] "BELA"Prihvatili ste zahtjev za goto!");
goToPlayer(gotoRequest[playerid], playerid);
gotoRequest[playerid] = -1;
}
else
{
new targetid = gotoRequest[playerid];
SCM(playerid, -1, ""SRWBOJA"[NK:RPG] "BELA"Odbili ste zahtev za goto!");
SCM(targetid, -1, ""SRWBOJA"[NK:RPG] "BELA"Vas zahtjev za goto je odbijen!");
gotoRequest[playerid] = -1;
}
return 1;
}
// Funkcija
goToPlayer(playerid, targetid) {
new Float:plx,
Float:ply,
Float:plz,
arank[24],
buffer[128];
GetPlayerPos(targetid, plx, ply, plz);
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
SetVehiclePos(GetPlayerVehicleID(playerid), plx, ply+4.0, plz);
}
else SetPlayerPos(playerid,plx,ply+2.0, plz);
SetPlayerInterior(playerid, GetPlayerInterior(targetid));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
if(PlayerInfo[playerid][pAdmin] == 1) { arank = "Admin Level 1"; }
else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "Admin Level 2"; }
else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "Admin Level 3"; }
else if(PlayerInfo[playerid][pAdmin] == 4) { arank = "Admin Level 4"; }
else if(PlayerInfo[playerid][pAdmin] == 5) { arank = "Admin Level 5 (Head-Admin)"; }
else if(PlayerInfo[playerid][pVlasnik] == 1) { arank = "Vlasnik"; }
else if(PlayerInfo[playerid][pAdmin] == 6) { arank = "Vlasnik"; }
else if(PlayerInfo[playerid][pGM] == 1) { arank = "GameMaster Level 1"; }
else if(PlayerInfo[playerid][pGM] == 2) { arank = "GameMaster Level 2"; }
else if(PlayerInfo[playerid][pGM] == 3) { arank = "GameMaster Level 3"; }
else if(PlayerInfo[playerid][pImunitet] == 1) { arank = "Spec Team"; }
else if(PlayerInfo[playerid][pVip] == 1) { arank = "Vip Level 1"; }
else if(PlayerInfo[playerid][pVip] == 2) { arank = "Vip Level 2"; }
else if(PlayerInfo[playerid][pVip] == 3) { arank = "Vip Level 3"; }
else if(PlayerInfo[playerid][pVip] == 4) { arank = "Vip Level 4"; }
else if(PlayerInfo[playerid][pVip] == 5) { arank = "Premium"; }
format(buffer, sizeof buffer,""ZUTA"[PORT] "BELA"Portao si se do igraca %s.",GetName(targetid));
SCM(playerid, -1, buffer);
format(buffer, sizeof buffer,""ZUTA"[PORT] "BELA"%s %s se portao do vas.",arank, GetName( playerid ) );
SCM(targetid, -1, buffer);
return 1;
}
Izbacuje mi error na ovoj liniji
[pawn]ShowPlayerDialog(targetid, -1, 0, '\0', '\0', '\0', '\0');[/pawn]
error 035: argument type mismatch (argument 4)
probaj vako
ShowPlayerDialog(targetid, -1, 0, " ", " ", " ", " ");
Citat: .кÑундер poslato Oktobar 14, 2018, 21:15:07 POSLE PODNE
probaj vako
ShowPlayerDialog(targetid, -1, 0, " ", " ", " ", " ");
e znam fixovao sam to bio :D
@.кÑундер Hvala ti puno ima samo jos jedna mala greskica kad se portas do nekog i on kad prihvati ja se portam do njega i pise zahtev za port je istekao da li ja mogu da malo vise produzim taj zahtev za port npr da stavim na 7sec?
imenujes timer i KIlll timer ako se porta samo -_-
forward gotoRequestExpire(playerid, targetid);
public gotoRequestExpire(playerid, targetid) {
if (gotoRequest[targetid] == -1) return 1;
gotoRequest[targetid] = -1;
ShowPlayerDialog(targetid, -1, 0, '\0', '\0', '\0', '\0');
SCM(playerid, -1, ""SRWBOJA"[NK:RPG] "BELA"Vas zahtjev za goto je istekao!");
return 1;
}
Hvala ti puno kralju!