o jogador sai-se automaticamente do carro pois se nгo sair do carro e ficar dentro as armas vгo se multiplicar
Код:
if(!strcmp(cmd, "/porarmacarro", true)) // by Klap
{
if(IsPlayerConnected(playerid))
{
new carro = GetPlayerVehicleID(playerid);
//new buyable = strval(tmp);
if(PlayerInfo[playerid][pChave] == carro || PlayerInfo[playerid][pChave2] == carro || PlayerInfo[playerid][pChave3] == carro || PlayerInfo[playerid][pChave4] == carro || PlayerInfo[playerid][pChave5] == carro || PlayerInfo[playerid][pChave6] == carro)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /porarmacarro [slot]");
return 1;
}
if(CopOnDuty[playerid] == 1 || SegOnDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "** Tбs em Duty Policial, Nao Aldrabes as tuas Armas!!!");
return 1;
}
new slot;
slot = strval(tmp);
new gunname[100];
new gunID = GetPlayerWeapon(playerid);
new gunAmmo = GetPlayerAmmo(playerid);
if(gunID != 0 && gunAmmo != 0)
{
if(slot < 1||slot > 3)
{
SendClientMessage(playerid, COLOR_GREY, "** Slot nao pode ser infrior a 1 ou suprior a 3!");
return 1;
}
if(slot == 1)
{
if(DynamicCars[carro][cWeapon1] != 0 || DynamicCars[carro][cAmmo1] != 0)
{
SendClientMessage(playerid, COLOR_GREY, "** Jб colocaste alguma coisa no Slot 1!");
return 1;
}
DynamicCars[carro][cWeapon1] = gunID;
DynamicCars[carro][cAmmo1] = gunAmmo;
RemovePlayerWeapon(playerid, gunID);
GetWeaponName(gunID, gunname, sizeof(gunname));
format(string, sizeof(string), "** Tu puseste uma %s no teu Slot 1.", gunname);
SendClientMessage(playerid, COLOR_GREY, string);
RemovePlayerWeapon(playerid, gunID);
}
if(slot == 2)
{
if(DynamicCars[carro][cWeapon2] != 0 || DynamicCars[carro][cAmmo2] != 0)
{
SendClientMessage(playerid, COLOR_GREY, "** Jб colocaste alguma coisa no Slot 2!");
return 1;
}
DynamicCars[carro][cWeapon2] = gunID;
DynamicCars[carro][cAmmo2] = gunAmmo;
RemovePlayerWeapon(playerid, gunID);
GetWeaponName(gunID, gunname, sizeof(gunname));
format(string, sizeof(string), "** Tu puseste uma %s no teu Slot 2.", gunname);
SendClientMessage(playerid, COLOR_GREY, string);
RemovePlayerWeapon(playerid, gunID);
}
if(slot == 3)
{
if(DynamicCars[carro][cWeapon3] != 0 || DynamicCars[carro][cAmmo3] != 0)
{
SendClientMessage(playerid, COLOR_GREY, "** Jб colocaste alguma coisa no Slot 3!");
return 1;
}
DynamicCars[carro][cWeapon3] = gunID;
DynamicCars[carro][cAmmo3] = gunAmmo;
RemovePlayerWeapon(playerid, gunID);
GetWeaponName(gunID, gunname, sizeof(gunname));
format(string, sizeof(string), "** Tu puseste uma %s no teu Slot 3.", gunname);
SendClientMessage(playerid, COLOR_GREY, string);
RemovePlayerWeapon(playerid, gunID);
}
PlayerActionMessage(playerid,15.0,"Coloca algo na traseira do carro.");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "** Este veiculo nгo й teu!");
}
}
return 1;
Aconselhava-te a criar um GM do 0,esse GM do klap,nunca o irбs entender se nunca tiveres uns bons meses de estudo nele. Comeзa a memorizar algumas cenas importantes,aprender a scriptar o bбsico e sу depois ir modificar esse GM,porque assim,terбs que andar sempre a pedir ajuda aqui no forum e nunca iras entender nada.
Para nгo dizer que servidores que usaram o GM do klap nгo passaram de 20 jogadores e sу conseguioa meter-se em pe durante 1 mes...