CMD:god(playerid, params[])
{
if(PlayerInMiniGame[playerid] != MINIGAME_NONE) return SendClientMessage(playerid, 0xFF4500FF, "Estб em um minijogo, use /sair");
if(IsPlayerInRace) return SendClientMessage(playerid, 0xFF4500FF, "Estб em uma corrida, use /saircorrida");
if(PlayerInfo[playerid][pGodMode] == 0)
{
GodCar[playerid] = 1;
PlayerInfo[playerid][pGodMode] = 1;
ResetPlayerWeapons(playerid);
SetPlayerHealth(playerid, 9999999);
godMode[playerid] = Create3DTextLabel("God Mode ON!", 0x008080FF, 30.0, 40.0, 50.0, 10.0, 0);
GameTextForPlayer(playerid, "~g~godmode~n~~y~on", 2000, 5);
Attach3DTextLabelToPlayer(godMode[playerid], playerid, 0.0, 0.0, 0.7);
}
else
{
GodCar[playerid] = 0;
PlayerInfo[playerid][pGodMode] = 0;
SetPlayerHealth(playerid, 100.0);
GameTextForPlayer(playerid, "~r~godmode~n~~y~off", 2000, 5);
Delete3DTextLabel(godMode[playerid]);
}
return 1;
}
if(!PlayerInfo[playerid][pGodMode])
if(PlayerInfo[playerid][pGodMode])
Sу oque vocк precisa saber:
Verificar se o player nгo estб em godmode pawn Код:
pawn Код:
OnPlayerEnterPickupPickup. Cheers. |
if(PlayerInfo[playerid][pGodMode])
{
ResetPlayerWeapons(playerid);
}
if(PlayerInfo[playerid][pGodMode] == 0) { ResetPlayerWeapons(playerid); //AQUI coloque a funзгo que dropa as armas do seu gamemode } else { ResetPlayerWeapons(playerid); }
Qual й a funзгo que no seu public OnPlayerDeath que esta fazendo as armas droparem, procure e coloque assim
Dentro da public OnPlayerDeath: Код:
if(PlayerInfo[playerid][pGodMode] == 0) { ResetPlayerWeapons(playerid); //AQUI coloque a funзгo que dropa as armas do seu gamemode } else { ResetPlayerWeapons(playerid); } |
if(GetPlayerWeapon(playerid) > 0)
{
new Float:pPosX, Float:pPosY, Float:pPosZ;
GetPlayerPos(playerid, pPosX, pPosY, pPosZ);
new r;
for(new i = 0; i != GetMaxPlayers()+100; i++)
{
if(DropGun[i][WeaponID] == 0)
{
r = i;
break;
}
}
DropGun[r][PickupID] = CreatePickup(GetWeaponModel(GetPlayerWeapon(playerid)), 19, pPosX, pPosY, pPosZ);
DropGun[r][WeaponID] = GetPlayerWeapon(playerid);
DropGun[r][Ammo] = minrand(100, 5000);
}
if(GetPlayerWeapon(playerid) > 0)
{
new Float:pPosX, Float:pPosY, Float:pPosZ;
GetPlayerPos(playerid, pPosX, pPosY, pPosZ);
new r;
for(new i = 0; i != GetMaxPlayers()+100; i++)
{
if(PlayerInfo[playerid][pGodMode] == 0)
{
ResetPlayerWeapons(playerid);
if(DropGun[i][WeaponID] == 0)
{
r = i;
break;
}
}
else
{
ResetPlayerWeapons(playerid);
}
}
DropGun[r][PickupID] = CreatePickup(GetWeaponModel(GetPlayerWeapon(playerid)), 19, pPosX, pPosY, pPosZ);
DropGun[r][WeaponID] = GetPlayerWeapon(playerid);
DropGun[r][Ammo] = minrand(100, 5000);
}
Nгo coloca na public OnPlayerDeath que a onde esta a funзгo de dropar as armas.
|
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerWeapon(playerid) > 0)
{
new Float:pPosX, Float:pPosY, Float:pPosZ;
GetPlayerPos(playerid, pPosX, pPosY, pPosZ);
new r;
for(new i = 0; i != GetMaxPlayers()+100; i++)
{
if(DropGun[i][WeaponID] == 0)
{
r = i;
break;
}
}
DropGun[r][PickupID] = CreatePickup(GetWeaponModel(GetPlayerWeapon(playerid)), 19, pPosX, pPosY, pPosZ);
DropGun[r][WeaponID] = GetPlayerWeapon(playerid);
DropGun[r][Ammo] = minrand(100, 5000);
}