Problem(error/warning): Iz nekog razloga ne teleportira igrace na duel mapu koju je igrac izabrao to jest onaj koji salje duel nekome.
Deo skripte:
Ide se redom prvo igrac pise /duel ID bet , pa onda izbaci listu oruzja za duel I onda kad se izabere oruzje onda izbaci dialog za biranje duel lokacije I onda se salje invite drugom igracu. I kad taj igrac prihvati duel, ne porta ih na lokaciju koja je izabrana u dialogu.
if(dialogid == DIALOG_DUEL_WEAPON)
{
if(response)
{
new weaponid;
switch(listitem)
{
case 0: weaponid = 9;
case 1: weaponid = 16;
case 2: weaponid = 17;
case 3: weaponid = 18;
case 4: weaponid = 22;
case 5: weaponid = 23;
case 6: weaponid = 24;
case 7: weaponid = 25;
case 8: weaponid = 26;
case 9: weaponid = 27;
case 10: weaponid = 28;
case 11: weaponid = 29;
case 12: weaponid = 30;
case 13: weaponid = 31;
case 14: weaponid = 32;
case 15: weaponid = 33;
case 16: weaponid = 34;
case 17: weaponid = 37;
default: weaponid = 24;
}
pDuel[playerid][duelWeapon] = weaponid;
pDuel[pDuel[playerid][duelPlayer]][duelWeapon] = weaponid;
ShowPlayerDialog(playerid, DIALOG_DUEL_MAP, DIALOG_STYLE_LIST, "Select the duel arena you wish to fight in.", "First Arena\nSecond Arena\nThird Arena", "Select", "Cancel");
}
}
if(dialogid == DIALOG_DUEL_MAP)
{
if(response)
{
switch(listitem)
{
case 0: pDuel[playerid][duelMap] = 0;
case 1: pDuel[playerid][duelMap] = 1;
case 2: pDuel[playerid][duelMap] = 2;
}
if(! IsPlayerConnected(pDuel[playerid][duelPlayer])) return SendClientMessage(playerid, COLOR_TOMATO, "* The opponent player is not connected.");
if(! IsPlayerSpawned(pDuel[playerid][duelPlayer])) return SendClientMessage(playerid, COLOR_TOMATO, "* You can't duel the player isn't spawned.");
if(pDuel[pDuel[playerid][duelPlayer]][duelActive]) return SendClientMessage(playerid, COLOR_TOMATO, "* Player is already in a duel.");
if(GetPlayerMoney(playerid) < pDuel[playerid][duelBet]) return SendClientMessage(playerid, COLOR_TOMATO, "* You don't have that much money.");
if(pDuel[playerid][duelBet] < 0) return SendClientMessage(playerid, COLOR_TOMATO, "* Bet must be at least 1$");
new sstring[256];
format(sstring, sizeof(sstring), "* You have send a duel request to %s(%i) with weapon %s, bet $%i.", ReturnPlayerName(pDuel[playerid][duelPlayer]), pDuel[playerid][duelPlayer], ReturnWeaponName(pDuel[playerid][duelWeapon]), pDuel[playerid][duelBet]);
SendClientMessage(playerid, LIGHTGREEN, sstring);
format(sstring, sizeof(sstring), "You have recieved a duel request from %s(%i)\n\n"YELLOW"Bet money: "WHITE"$%i\n"YELLOW"Weapon: "WHITE"%s", ReturnPlayerName(playerid), playerid, pDuel[playerid][duelBet], ReturnWeaponName(pDuel[playerid][duelWeapon]));
ShowPlayerDialog(pDuel[playerid][duelPlayer], DIALOG_DUEL, DIALOG_STYLE_MSGBOX, ""YELLOW"Duel Request", sstring, "Accept", "Ignore");
}
}
if(dialogid == DIALOG_DUEL)
{
if(! response)
{
SendClientMessage(pDuel[playerid][duelPlayer], COLOR_TOMATO, "* Your duel request was ignored!");
pDuel[pDuel[playerid][duelPlayer]][duelActive] = false;
pDuel[pDuel[playerid][duelPlayer]][duelPlayer] = INVALID_PLAYER_ID;
pDuel[pDuel[playerid][duelPlayer]][duelWeapon] = 0;
pDuel[pDuel[playerid][duelPlayer]][duelBet] = 0;
pDuel[pDuel[playerid][duelPlayer]][duelMap] = -1;
pDuel[playerid][duelActive] = false;
pDuel[playerid][duelPlayer] = INVALID_PLAYER_ID;
pDuel[playerid][duelWeapon] = 0;
pDuel[playerid][duelBet] = 0;
pDuel[playerid][duelMap] = -1;
}
if(response)
{
if(! IsPlayerConnected(pDuel[playerid][duelPlayer])) return SendClientMessage(playerid, COLOR_TOMATO, "* The opponent player is not connected.");
if(! IsPlayerSpawned(pDuel[playerid][duelPlayer])) return SendClientMessage(playerid, COLOR_TOMATO, "* You can't duel the player isn't spawned.");
if(pDuel[pDuel[playerid][duelPlayer]][duelActive]) return SendClientMessage(playerid, COLOR_TOMATO, "* Player is already in a duel.");
if(GetPlayerMoney(playerid) < pDuel[playerid][duelBet]) return SendClientMessage(playerid, COLOR_TOMATO, "* You don't have that much money.");
if(pDuel[playerid][duelBet] < 0) return SendClientMessage(playerid, COLOR_TOMATO, "* Bet must be at least $1!");
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, pDuel[playerid][duelWeapon], 9999999);
SetPlayerHealth(playerid, 100.0);
SetPlayerArmour(playerid, 100.0);
GameTextForPlayer(playerid, "~g~GO! GO! GO!", 2000, 4);
ResetPlayerWeapons(pDuel[playerid][duelPlayer]);
GivePlayerWeapon(pDuel[playerid][duelPlayer], pDuel[playerid][duelWeapon], 9999999);
SetPlayerHealth(pDuel[playerid][duelPlayer], 100.0);
SetPlayerArmour(pDuel[playerid][duelPlayer], 100.0);
GameTextForPlayer(pDuel[playerid][duelPlayer], "~g~GO! GO! GO!", 2000, 4);
switch(pDuel[playerid][duelMap])
{
case 0:
{
SetPlayerPos(playerid, -1404.067, 1270.3706, 1042.8672);
SetPlayerInterior(playerid, 16);
SetPlayerVirtualWorld(playerid, playerid);
SetPlayerPos(pDuel[playerid][duelPlayer], -1395.067, 1261.3706, 1042.8672);
SetPlayerInterior(pDuel[playerid][duelPlayer], 16);
SetPlayerVirtualWorld(pDuel[playerid][duelPlayer], playerid);
}
case 1:
{
SetPlayerPos(playerid, 1353.407,2188.155,11.02344);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, playerid);
SetPlayerPos(pDuel[playerid][duelPlayer], 1346.255,2142.843,11.01563);
SetPlayerInterior(pDuel[playerid][duelPlayer], 0);
SetPlayerVirtualWorld(pDuel[playerid][duelPlayer], playerid);
}
case 2:
{
SetPlayerPos(playerid, -1041.037,1078.729,1347.678);
SetPlayerInterior(playerid, 10);
SetPlayerVirtualWorld(playerid, playerid);
SetPlayerFacingAngle(playerid, 135);
SetPlayerPos(pDuel[playerid][duelPlayer], -1018.061,1052.502,1346.327);
SetPlayerInterior(pDuel[playerid][duelPlayer], 10);
SetPlayerVirtualWorld(pDuel[playerid][duelPlayer], playerid);
SetPlayerFacingAngle(pDuel[playerid][duelPlayer], 45);
}
}
new sstring[144];
format(sstring, sizeof(sstring), "DUEL: A duel between %s(%i) and %s(%i) started! (Weapon: %s : Bet: $%i)", ReturnPlayerName(playerid), playerid, ReturnPlayerName(pDuel[playerid][duelPlayer]), pDuel[playerid][duelPlayer], ReturnWeaponName(pDuel[playerid][duelWeapon]), pDuel[playerid][duelBet]);
SendClientMessageToAll(LIGHTGREEN, sstring);
pDuel[pDuel[playerid][duelPlayer]][duelActive] = true;
pDuel[playerid][duelActive] = true;
return 1;
}
}
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