Quero colocar esse comando para sу vender arma quando o Mafioso e o comprador estiverem dentro do Boxville .
pawn Код:
if(strcmp(cmd, "/mafiavkit", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJailed] != 0)
{
SCM(playerid,COLOR_YELLOW," Vocк nгo pode vender armas na cadeia!");
return 1;
}
new carid = GetPlayerVehicleID(playerid);
if(!IsACaminhaozinhoCar(carid))
{
SCM(playerid,COLOR_GRAD1,"Vocк precisa estar dentro do BoxVille");
return 1;
}
if (PlayerInfo[playerid][pMembro] == 13 || PlayerInfo[playerid][pLider] == 13 || PlayerInfo[playerid][pMembro] == 12 || PlayerInfo[playerid][pLider] == 12)
{
new x_nr[32];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr))
{
SCM(playerid,COLOR_WHITE,"|__________________ Vender Armas - Mafiosos __________________|");
SCM(playerid,COLOR_GREY,"USE: /mafiavkit [1 a 3] [ID do Player] ");
SCM(playerid,COLOR_GREY,"Kit 1: Shotgun,m4,mp5(399 Materiais)");
SCM(playerid,COLOR_GREY,"Kit 2: Eagle,Shotgun,m4,mp5(499 Materiais)");
SCM(playerid,COLOR_GREY,"Kit 3: Eagle,Shotgun,m4,mp5,sniper,faca(599 Materiais)");
return 1;
}
else if(strcmp(x_nr,"1",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SCM(playerid,COLOR_WHITE,"|__________________ Vender Armas - Mafiosos __________________|");
SCM(playerid,COLOR_GREY,"USE: /mafiavkit [1 a 3] [ID do Player] ");
SCM(playerid,COLOR_GREY,"Kit 1: Shotgun,m4,mp5(399 Materiais)");
SCM(playerid,COLOR_GREY,"Kit 2: Eagle,Shotgun,m4,mp5(499 Materiais)");
SCM(playerid,COLOR_GREY,"Kit 3: Eagle,Shotgun,m4,mp5,sniper,faca(599 Materiais)");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(giveplayerid == playerid) { SCM(playerid, COLOR_GREY, "Vocк nгo pode se vender armas!"); return 1; }
new carid1 = GetPlayerVehicleID(giveplayerid);
if(IsACop(giveplayerid))
{
SCM(playerid,COLOR_GRAD1,"Vocк nгo pode vender kit para policiais");
return 1;
}
if(!IsACaminhaozinhoCar(carid1))
{
SCM(playerid,COLOR_GRAD1,"O player para quem vocк vai vender precisa estar dentro do BoxVille");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(PlayerInfo[playerid][pMats] > 399)
{
GivePlayerMoney(giveplayerid, -10000);
GivePlayerMoney(playerid, 10000);
PlayerInfo[playerid][pMats] -= 399;
GivePlayerWeapon(playerid, 5, 1);
GivePlayerWeapon(playerid, 8, 1);
GivePlayerWeapon(playerid, 16, 3);
GivePlayerWeapon(playerid, 24, 150);
GivePlayerWeapon(playerid, 25, 150);
GivePlayerWeapon(playerid, 29, 300);
GivePlayerWeapon(playerid, 30, 300);
GivePlayerWeapon(playerid, 34, 3);
SetPlayerArmour(playerid, 100.0);
SetPlayerHealth(playerid, 100.0);
format(string,sizeof(string),"Voce vendeu o kit 1,para %s.",giveplayer);
SCM(playerid,COLOR_GRAD1,string);
format(string,sizeof(string),"* %s vendeu kits para %s.",sendername ,giveplayer);
ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
else
{
SCM(playerid,COLOR_GREY,"Materiais insuficientes para vender este kit!");
return 1;
}
}
}
else
{
SCM(playerid, COLOR_GREY, " O Jogador Estб Offline !");
return 1;
}
}
else if(strcmp(x_nr,"2",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SCM(playerid,COLOR_WHITE,"|__________________ Vender Armas - Mafiosos __________________|");
SCM(playerid,COLOR_GREY,"USE: /mafiavkit [1 a 3] [ID do Player] ");
SCM(playerid,COLOR_GREY,"Kit 1: Shotgun,m4,mp5(399)");
SCM(playerid,COLOR_GREY,"Kit 2: Eagle,Shotgun,m4,mp5(499)");
SCM(playerid,COLOR_GREY,"Kit 3: Eagle,Shotgun,m4,mp5,sniper,faca(599)");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(giveplayerid == playerid) { SCM(playerid, COLOR_GREY, "Vocк nгo pode se vender armas!"); return 1; }
new carid2 = GetPlayerVehicleID(giveplayerid);
if(IsACop(giveplayerid))
{
SCM(playerid,COLOR_GRAD1,"Vocк nгo pode vender kit para policiais");
return 1;
}
if(!IsACaminhaozinhoCar(carid2))
{
SCM(playerid,COLOR_GRAD1,"O player para quem vocк vai vender precisa estar dentro do BoxVille");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(PlayerInfo[playerid][pMats] > 499)
{
GivePlayerMoney(giveplayerid, -12000);
GivePlayerMoney(playerid, 12000);
PlayerInfo[playerid][pMats] -= 499;
GivePlayerWeapon(playerid, 5, 1);
GivePlayerWeapon(playerid, 8, 1);
GivePlayerWeapon(playerid, 16, 3);
GivePlayerWeapon(playerid, 24, 150);
GivePlayerWeapon(playerid, 25, 150);
GivePlayerWeapon(playerid, 29, 300);
GivePlayerWeapon(playerid, 30, 300);
GivePlayerWeapon(playerid, 34, 3);
SetPlayerArmour(playerid, 100.0);
SetPlayerHealth(playerid, 100.0);
format(string,sizeof(string),"Voce vendeu o kit 2,para %s.",giveplayer);
SCM(playerid,COLOR_GRAD1,string);
format(string,sizeof(string),"* %s vendeu kits para %s.",sendername ,giveplayer);
ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
else
{
SCM(playerid,COLOR_GREY,"Materiais insuficientes para vender este kit!");
return 1;
}
}
else
{
SCM(playerid, COLOR_GREY, " O Jogador Estб Offline !");
return 1;
}
}
else if(strcmp(x_nr,"3",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SCM(playerid,COLOR_WHITE,"|__________________ Vender Armas - Mafiosos __________________|");
SCM(playerid,COLOR_GREY,"USE: /mafiavkit [1 a 3] [ID do Player] ");
SCM(playerid,COLOR_GREY,"Kit 1: Shotgun,m4,mp5(399)");
SCM(playerid,COLOR_GREY,"Kit 2: Eagle,Shotgun,m4,mp5(499)");
SCM(playerid,COLOR_GREY,"Kit 3: Eagle,Shotgun,m4,mp5,sniper,faca(599)");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(giveplayerid == playerid) { SCM(playerid, COLOR_GREY, "Vocк nгo pode se vender armas!"); return 1; }
new carid3 = GetPlayerVehicleID(giveplayerid);
if(IsACop(giveplayerid))
{
SCM(playerid,COLOR_GRAD1,"Vocк nгo pode vender kit para policiais");
return 1;
}
if(!IsACaminhaozinhoCar(carid3))
{
SCM(playerid,COLOR_GRAD1,"O player para quem vocк vai vender precisa estar dentro do BoxVille");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(PlayerInfo[playerid][pMats] > 599)
{
GivePlayerMoney(giveplayerid, -15000);
GivePlayerMoney(playerid, 15000);
PlayerInfo[playerid][pMats] -= 599;
GivePlayerWeapon(playerid, 5, 1);
GivePlayerWeapon(playerid, 8, 1);
GivePlayerWeapon(playerid, 16, 3);
GivePlayerWeapon(playerid, 24, 150);
GivePlayerWeapon(playerid, 25, 150);
GivePlayerWeapon(playerid, 29, 300);
GivePlayerWeapon(playerid, 30, 300);
GivePlayerWeapon(playerid, 34, 3);
SetPlayerArmour(playerid, 100.0);
SetPlayerHealth(playerid, 100.0);
format(string,sizeof(string),"Voce vendeu o kit 3,para %s.",giveplayer);
SCM(playerid,COLOR_GRAD1,string);
format(string,sizeof(string),"* %s vendeu kits para %s.",sendername ,giveplayer);
ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
else
{
SCM(playerid,COLOR_GREY,"Materiais insuficientes para vender este kit!");
return 1;
}
}
else
{
SCM(playerid, COLOR_GREY, " O Jogador Estб Offline !");
return 1;
}
}
}
else
{
SCM(playerid,COLOR_GREY,"Vocк nгo й de nenhuma Organizaзгo Mafiosa!");
return 1;
}
}
return 1;
}