I still having problems about the death the strange thing is that with a minigame works but with the duel, it kills the player. What is the problem? Here is the code.
Код:
if(!strcmp("/duelo",cmdtext))
{
GetPlayerPos(playerid,playerpos[playerid][0],playerpos[playerid][1],playerpos[playerid][2]);
GetPlayerFacingAngle(playerid,playerpos[playerid][3]);
interior[playerid] = GetPlayerInterior(playerid);
virtualworld[playerid] = GetPlayerVirtualWorld(playerid);
SetPlayerPos(playerid, 1314.6309, 2184.8245, 11.0234);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
return 1;
}
if(!strcmp("/dm1",cmdtext))
{
GetPlayerHealth(playerid, Health[playerid]);
GetPlayerArmour(playerid, Armor[playerid]);
GetPlayerPos(playerid,playerpos[playerid][0],playerpos[playerid][1],playerpos[playerid][2]);
GetPlayerFacingAngle(playerid,playerpos[playerid][3]);
interior[playerid] = GetPlayerInterior(playerid);
virtualworld[playerid] = GetPlayerVirtualWorld(playerid);
for (new i = 0; i <= 12; i++)
{
GetPlayerWeaponData(playerid, i, weapondata[playerid][i][0], weapondata[playerid][i][1]);
}
SetPlayerPos(playerid,1412.639892,-1.787510,1000.924377);
SetPlayerVirtualWorld(playerid,1);
SetPlayerInterior(playerid,1);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 26,1000);
GivePlayerWeapon(playerid,32,1000);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
return 1;
}
if(!strcmp("/dm",cmdtext))
{
SetPlayerHealth(playerid, Health[playerid]);
SetPlayerArmour(playerid, Armor[playerid]);
SetPlayerPos(playerid,playerpos[playerid][0],playerpos[playerid][1],playerpos[playerid][2]);
SetPlayerFacingAngle(playerid,playerpos[playerid][3]);
SetPlayerInterior(playerid,interior[playerid]);
SetPlayerVirtualWorld(playerid,virtualworld[playerid]);
ResetPlayerWeapons(playerid);
for (new i = 0; i <= 12; i++)
{
GivePlayerWeapon(playerid,weapondata[playerid][i][0], weapondata[playerid][i][1]);
}
return 1;
}