public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu: Current = GetPlayerMenu(playerid);
if (Current == outrosmenu)
{
switch (row)
{
case 0:
ShowMenuForPlayer(outrosmenu, playerid);
}
}
if (Current == outrosmenu)
{
switch(row)
{
case 0: // Outros
{ // Mini
TogglePlayerControllable(playerid, true);
SetPVarInt( playerid, "minigun", 1 );
SetPVarInt( playerid, "minigun", CreateObject( 362,0,0,0,0,0,0 ));
SetPVarInt( playerid, "minigun2", CreateObject( 362,0,0,0,0,0,0 ));
AttachObjectToVehicle( GetPVarInt( playerid, "minigun" ), GetPlayerVehicleID( playerid ), -1.200000,0.075000,0.150000,-2.700001,27.000005,-264.599853 );
AttachObjectToVehicle( GetPVarInt( playerid, "minigun2" ), GetPlayerVehicleID( playerid ), 1.274999,0.075000,0.150000,-2.700001,27.000005,-264.599853 );
SendClientMessage( playerid, 0xFFFFFFAA, "Minigun de enfeite Instalada" );
}
Uй, acho que й sу vocк remover antes de adicionar o efeito. Daн, toda vez que o jogador for instalar o efeito, ficarб apenas um.
|
if(GetPVarInt(playerid, "minigun") != 0) return SendClientMessage(playerid, -1, "[ERRO] Seu carro jб tem minigun");
public OnPlayerExitVehicle(playerid, vehicleid)
{
DestroyObject( GetPVarInt( playerid, "minigun" ));
DeletePVar( playerid, "minigun" );
DestroyObject( GetPVarInt( playerid, "minigun2" ));
DeletePVar( playerid, "minigun" );
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu: Current = GetPlayerMenu(playerid);
if (Current == outrosmenu)
{
switch (row)
{
case 0:
ShowMenuForPlayer(outrosmenu, playerid);
}
}
if (Current == outrosmenu)
{
switch(row)
{
case 0: // Outros
if(GetPVarInt(playerid, "minigun") != 0) //<<<<<<<<<<<<
{ // Mini
TogglePlayerControllable(playerid, true);
SetPVarInt( playerid, "minigun", 1 );
SetPVarInt( playerid, "minigun", CreateObject( 362,0,0,0,0,0,0 ));
SetPVarInt( playerid, "minigun2", CreateObject( 362,0,0,0,0,0,0 ));
AttachObjectToVehicle( GetPVarInt( playerid, "minigun" ), GetPlayerVehicleID( playerid ), -1.200000,0.075000,0.150000,-2.700001,27.000005,-264.599853 );
AttachObjectToVehicle( GetPVarInt( playerid, "minigun2" ), GetPlayerVehicleID( playerid ), 1.274999,0.075000,0.150000,-2.700001,27.000005,-264.599853 );
SendClientMessage( playerid, 0xFFFFFFAA, "Minigun de enfeite Instalada" );
return SendClientMessage(playerid, -1, "[ERRO] Seu carro jб tem minigun"); //<<<<<<<<<<
}
public OnPlayerSelectedMenuRow(playerid, row) { new Menu: Current = GetPlayerMenu(playerid); if (Current == outrosmenu) { switch (row) { case 0: ShowMenuForPlayer(outrosmenu, playerid); } } if (Current == outrosmenu) { switch(row) { case 0:// Mini { if(GetPVarInt(playerid, "minigun") != 0) return SendClientMessage(playerid, -1, "[ERRO] Seu carro jб tem minigun"); TogglePlayerControllable(playerid, true); SetPVarInt( playerid, "minigun", 1 ); SetPVarInt( playerid, "minigun", CreateObject( 362,0,0,0,0,0,0 )); SetPVarInt( playerid, "minigun2", CreateObject( 362,0,0,0,0,0,0 )); AttachObjectToVehicle( GetPVarInt( playerid, "minigun" ), GetPlayerVehicleID( playerid ), -1.200000,0.075000,0.150000,-2.700001,27.000005,-264.599853 ); AttachObjectToVehicle( GetPVarInt( playerid, "minigun2" ), GetPlayerVehicleID( playerid ), 1.274999,0.075000,0.150000,-2.700001,27.000005,-264.599853 ); SendClientMessage( playerid, 0xFFFFFFAA, "Minigun de enfeite Instalada" ); }
Boa cara funcionou !!! Sу tem mais 1 probleminha, tipo, quando eu adiciono o mesmo efeito na segunda vez, ele bloqueia certinho, mais em contrapartida o carro fica travado, nao anda !!!
|
if(GetPVarInt(playerid, "minigun") != 0) { SendClientMessage(playerid, -1, "[ERRO] Seu carro jб tem minigun"); TogglePlayerControllable(playerid, true); return 1; }