dcmd_venderarmas(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(Player[playerid][pJob] != VARMAS)
return SendClientMessage(playerid,COLOR_ORANGE,"Vocк nгo й um vendedor de armas.");
if(PlayerToPoint(40.0, playerid, 245.9469,75.8629,1003.6406))
return SendClientMessage(playerid, COLOR_WHITE, "[ERRO] Vocк nгo pode vender armas na DP! ");
new x_weapon[256],weapon[MAX_PLAYERS],ammo[MAX_PLAYERS],price[MAX_PLAYERS];
new tmp[24], idx; tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "[USO] /venderarmas [id/nick] [nome da arma]");
SendClientMessage(playerid, COLOR_GREY, "Armas: flores(25) sdpistol(100) eagle(150) mp5(200) escopeta(200)");
SendClientMessage(playerid, COLOR_GREY, "Armas: ak47(600) m4(600) rifle (600) paraquedas (100)");
return 1;
}
new giveid = ReturnUser(tmp);
if(IsPlayerConnected(giveid))
{
if(giveid != INVALID_PLAYER_ID)
{
if(Treinando[giveid][0] > 0)
return SendClientMessage(playerid,COLOR_RED,"[ERRO] Jogador estб treinando.");
if(Player[giveid][pExp] < 0)
return SendClientMessage(playerid, COLOR_RED, "O jogador ainda nгo pode usar armas.");
x_weapon = strtok(params, idx);
if(!strlen(x_weapon))
{
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
SendClientMessage(playerid, COLOR_WHITE, "*** Vender de armas ***");
SendClientMessage(playerid, COLOR_GREY, "[USO] /venderarmas [id/nick] [nome da arma]");
SendClientMessage(playerid, COLOR_GREY, "Armas: flores(25) sdpistol(100) eagle(200) mp5(200) escopeta(200)");
SendClientMessage(playerid, COLOR_GREY, "Armas: ak47(600) m4(600) rifle(600) paraquedas (100) spray (50)");
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
return 1;
}
}
if(strcmp(x_weapon,"sdpistol", true) == 0) { if(Player[playerid][pMats] > 99) { weapon[playerid] = 23; price[playerid] = 100; ammo[playerid] = 50; Player[giveid][pGun2] = 23; Player[giveid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"flores", true) == 0) { if(Player[playerid][pMats] > 24) { weapon[playerid] = 14; price[playerid] = 25; ammo[playerid] = 1; Player[giveid][pGun1] = 14; Player[giveid][pAmmo1] = 1; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"eagle", true) == 0) { if(Player[playerid][pMats] > 199) { weapon[playerid] = 24; price[playerid] = 150; ammo[playerid] = 50; Player[giveid][pGun2] = 24; Player[giveid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"mp5", true) == 0) { if(Player[playerid][pMats] > 199) { weapon[playerid] = 29; price[playerid] = 200; ammo[playerid] = 200; Player[giveid][pGun2] = 29; Player[giveid][pAmmo2] = 200; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"escopeta", true) == 0) { if(Player[playerid][pMats] > 199) { weapon[playerid] = 25; price[playerid] = 200; ammo[playerid] = 50; Player[giveid][pGun2] = 25; Player[giveid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"ak47", true) == 0) { if(Player[playerid][pMats] > 599) { weapon[playerid] = 30; price[playerid] = 600; ammo[playerid] = 250; Player[giveid][pGun2] = 30; Player[giveid][pAmmo2] = 250; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"m4", true) == 0) { if(Player[playerid][pMats] > 599) { weapon[playerid] = 31; price[playerid] = 600; ammo[playerid] = 250; Player[giveid][pGun2] = 31; Player[giveid][pAmmo2] = 250; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"rifle", true) == 0) { if(Player[playerid][pMats] > 599) { weapon[playerid] = 33; price[playerid] = 600; ammo[playerid] = 50; Player[giveid][pGun2] = 33; Player[giveid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"paraquedas", true) == 0) { if(Player[playerid][pMats] > 99) { weapon[playerid] = 46; price[playerid] = 100; ammo[playerid] = 1; Player[giveid][pGun2] = 46; Player[giveid][pAmmo2] = 1; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"spray", true) == 0) { if(Player[playerid][pMats] > 20) { weapon[playerid] = 41; price[playerid] = 50; ammo[playerid] = 300; Player[giveid][pGun2] = 41; Player[giveid][pAmmo2] = 300; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else { SendClientMessage(playerid,COLOR_GREY," Nome inexistente."); return 1; }
if(ProxDetectorS(5.0, playerid, giveid))
{
if(giveid == playerid)
return SendClientMessage(playerid, COLOR_RED, "[ERRO] Vocк nгo pode vender armas a vocк mesmo");
if(Player[playerid][pMiserPerk] > 0)
{
new skill = 2 * Player[playerid][pMiserPerk];
new mats = price[playerid] / 100;
price[playerid] -= (mats)*(skill);
}
ConsumingMoney[playerid] = 1;
format(thestring, sizeof(thestring), " Vocк deu a %s uma %s com %d municхes usando %d materiais.", Player[giveid][pName],x_weapon, ammo[playerid], price[playerid]);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GREY, thestring);
format(thestring, sizeof(thestring), " Vocк recebeu uma %s com %d de %s.", x_weapon, ammo[playerid], Player[playerid][pName]);
SendClientMessage(giveid, COLOR_GREY, thestring);
PlayerPlaySound(giveid, 1052, 0.0, 0.0, 0.0);
format(thestring, sizeof(thestring), "%s recebeu armas de %s.", Player[giveid][pName], Player[playerid][pName]);
ProxDetector(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new gunname[100];
GetWeaponName(weapon[playerid], gunname, sizeof(gunname));
format(thestring, sizeof(thestring), "%s vendeu uma %s para %s.", Player[playerid][pName], gunname,Player[giveid][pName]);
ProxDetector(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SafeGivePlayerWeapon(giveid,weapon[playerid],ammo[playerid]);
Player[playerid][pMats] -= price[playerid];
}
else
return SendClientMessage(playerid, COLOR_RED,"[ERRO] Aproxime-se.");
}
else
{
format(thestring, sizeof(thestring), " %d Invбlido", giveid);
SendClientMessage(playerid, COLOR_GREY, thestring);
}
}
return 1;
}
dcmd_venderarmas(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(Player[playerid][pJob] != VARMAS || Player[playerid][pMember] == TEAM_RUSSA || Player[playerid][pLeader] == TEAM_RUSSA || Player[playerid][pMember] == TEAM_YAKUZA || Player[playerid][pLeader] == TEAM_YAKUZA)
return SendClientMessage(playerid,COLOR_ORANGE,"Vocк nгo й um vendedor de armas.");
if(PlayerToPoint(40.0, playerid, 245.9469,75.8629,1003.6406))
return SendClientMessage(playerid, COLOR_WHITE, "[ERRO] Vocк nгo pode vender armas na DP! ");
new x_weapon[256],weapon[MAX_PLAYERS],ammo[MAX_PLAYERS],price[MAX_PLAYERS];
new tmp[24], idx; tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "[USO] /venderarmas [id/nick] [nome da arma]");
SendClientMessage(playerid, COLOR_GREY, "Armas: flores(25) sdpistol(100) eagle(150) mp5(200) escopeta(200)");
SendClientMessage(playerid, COLOR_GREY, "Armas: ak47(600) m4(600) rifle (600) paraquedas (100)");
return 1;
}
new giveid = ReturnUser(tmp);
if(IsPlayerConnected(giveid))
{
if(giveid != INVALID_PLAYER_ID)
{
if(Treinando[giveid][0] > 0)
return SendClientMessage(playerid,COLOR_RED,"[ERRO] Jogador estб treinando.");
if(Player[giveid][pExp] < 0)
return SendClientMessage(playerid, COLOR_RED, "O jogador ainda nгo pode usar armas.");
x_weapon = strtok(params, idx);
if(!strlen(x_weapon))
{
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
SendClientMessage(playerid, COLOR_WHITE, "*** Vender de armas ***");
SendClientMessage(playerid, COLOR_GREY, "[USO] /venderarmas [id/nick] [nome da arma]");
SendClientMessage(playerid, COLOR_GREY, "Armas: flores(25) sdpistol(100) eagle(200) mp5(200) escopeta(200)");
SendClientMessage(playerid, COLOR_GREY, "Armas: ak47(600) m4(600) rifle(600) paraquedas (100) spray (50)");
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
return 1;
}
}
if(strcmp(x_weapon,"sdpistol", true) == 0) { if(Player[playerid][pMats] > 99) { weapon[playerid] = 23; price[playerid] = 100; ammo[playerid] = 50; Player[giveid][pGun2] = 23; Player[giveid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"flores", true) == 0) { if(Player[playerid][pMats] > 24) { weapon[playerid] = 14; price[playerid] = 25; ammo[playerid] = 1; Player[giveid][pGun1] = 14; Player[giveid][pAmmo1] = 1; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"eagle", true) == 0) { if(Player[playerid][pMats] > 199) { weapon[playerid] = 24; price[playerid] = 150; ammo[playerid] = 50; Player[giveid][pGun2] = 24; Player[giveid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"mp5", true) == 0) { if(Player[playerid][pMats] > 199) { weapon[playerid] = 29; price[playerid] = 200; ammo[playerid] = 200; Player[giveid][pGun2] = 29; Player[giveid][pAmmo2] = 200; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"escopeta", true) == 0) { if(Player[playerid][pMats] > 199) { weapon[playerid] = 25; price[playerid] = 200; ammo[playerid] = 50; Player[giveid][pGun2] = 25; Player[giveid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"ak47", true) == 0) { if(Player[playerid][pMats] > 599) { weapon[playerid] = 30; price[playerid] = 600; ammo[playerid] = 250; Player[giveid][pGun2] = 30; Player[giveid][pAmmo2] = 250; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"m4", true) == 0) { if(Player[playerid][pMats] > 599) { weapon[playerid] = 31; price[playerid] = 600; ammo[playerid] = 250; Player[giveid][pGun2] = 31; Player[giveid][pAmmo2] = 250; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"rifle", true) == 0) { if(Player[playerid][pMats] > 599) { weapon[playerid] = 33; price[playerid] = 600; ammo[playerid] = 50; Player[giveid][pGun2] = 33; Player[giveid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"paraquedas", true) == 0) { if(Player[playerid][pMats] > 99) { weapon[playerid] = 46; price[playerid] = 100; ammo[playerid] = 1; Player[giveid][pGun2] = 46; Player[giveid][pAmmo2] = 1; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"spray", true) == 0) { if(Player[playerid][pMats] > 20) { weapon[playerid] = 41; price[playerid] = 50; ammo[playerid] = 300; Player[giveid][pGun2] = 41; Player[giveid][pAmmo2] = 300; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else { SendClientMessage(playerid,COLOR_GREY," Nome inexistente."); return 1; }
if(ProxDetectorS(5.0, playerid, giveid))
{
if(giveid == playerid)
return SendClientMessage(playerid, COLOR_RED, "[ERRO] Vocк nгo pode vender armas a vocк mesmo");
if(Player[playerid][pMiserPerk] > 0)
{
new skill = 2 * Player[playerid][pMiserPerk];
new mats = price[playerid] / 100;
price[playerid] -= (mats)*(skill);
}
ConsumingMoney[playerid] = 1;
format(thestring, sizeof(thestring), " Vocк deu a %s uma %s com %d municхes usando %d materiais.", Player[giveid][pName],x_weapon, ammo[playerid], price[playerid]);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GREY, thestring);
format(thestring, sizeof(thestring), " Vocк recebeu uma %s com %d de %s.", x_weapon, ammo[playerid], Player[playerid][pName]);
SendClientMessage(giveid, COLOR_GREY, thestring);
PlayerPlaySound(giveid, 1052, 0.0, 0.0, 0.0);
format(thestring, sizeof(thestring), "%s recebeu armas de %s.", Player[giveid][pName], Player[playerid][pName]);
ProxDetector(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new gunname[100];
GetWeaponName(weapon[playerid], gunname, sizeof(gunname));
format(thestring, sizeof(thestring), "%s vendeu uma %s para %s.", Player[playerid][pName], gunname,Player[giveid][pName]);
ProxDetector(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SafeGivePlayerWeapon(giveid,weapon[playerid],ammo[playerid]);
Player[playerid][pMats] -= price[playerid];
}
else
return SendClientMessage(playerid, COLOR_RED,"[ERRO] Aproxime-se.");
}
else
{
format(thestring, sizeof(thestring), " %d Invбlido", giveid);
SendClientMessage(playerid, COLOR_GREY, thestring);
}
}
return 1;
}
if(strcmp(cmd,"/VenderArma",true)==0)
{
if(PlayerInfo[playerid][pJailed] != 0)
{
SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode vender armas na cadeia!");
return true;
}
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pEmprego] != 7)//Troque o 7 pelo numero do Emprego de Vendedor de Armas
{
SendClientMessage(playerid,COLOR_GREY,"Vocк nгo й um Vendendor de Armas !");
return true;
}
giveplayerid = ReturnUser(tmp);
if (giveplayerid == playerid)
{
SendClientMessage(playerid,COLOR_GREY,"Vocк nгo pode vender armas pra si mesmo!");
return true;
}
new x_weapon[32],weapon[MAX_PLAYERS],ammo[MAX_PLAYERS],price[MAX_PLAYERS];
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GRAD1,"USE: /VenderArma [ID do Player] [Arma]");
SendClientMessage(playerid,COLOR_GREY,"Armas: flowers(25) spistola(100) pistola(150) mp5(200) shotgun(200)");
SendClientMessage(playerid,COLOR_GREY,"Armas: rifle (600) ak47(600) m4(600)");
return true;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
x_weapon = strtok(cmdtext,idx);
if(!strlen(x_weapon))
{
SendClientMessage(playerid,COLOR_WHITE,"|__________________[ Vender Armas ]__________________|");
SendClientMessage(playerid,COLOR_GREY,"USE: /VenderArma [ID do Players] [weaponname]");
SendClientMessage(playerid,COLOR_GREY,"Armas: spistola(100) eagle(200) mp5(200)");
SendClientMessage(playerid,COLOR_GREY,"Armas: rifle(600) flores(25) ak47(600) m4(600) rifle(600)");
return true;
}
}
//if(strcmp(x_weapon,"knife",true) == 0) { if(PlayerInfo[playerid][pMats] > 99) { weapon[playerid] = 4; price[playerid] = 100; ammo[playerid] = 1; PlayerInfo[giveplayerid][pGun1] = 4; PlayerInfo[giveplayerid][pAmmo1] = 1; } else { SendClientMessage(playerid,COLOR_GREY,"Not enough Materials for that Weapon!"); return true; } }
if(strcmp(x_weapon,"spistola",true) == 0) { if(PlayerInfo[playerid][pMats] > 99) { weapon[playerid] = 23; price[playerid] = 100; ammo[playerid] = 50; PlayerInfo[giveplayerid][pGun2] = 23; PlayerInfo[giveplayerid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY,"Materiais insulficiente para Arma!"); return true; } }
else if(strcmp(x_weapon,"flowers",true) == 0) { if(PlayerInfo[playerid][pMats] > 24) { weapon[playerid] = 14; price[playerid] = 25; ammo[playerid] = 1; PlayerInfo[giveplayerid][pGun1] = 14; PlayerInfo[giveplayerid][pAmmo1] = 1; } else { SendClientMessage(playerid,COLOR_GREY,"Materiais insulficiente para Arma!"); return true; } }
else if(strcmp(x_weapon,"pistola",true) == 0) { if(PlayerInfo[playerid][pMats] > 199) { weapon[playerid] = 22; price[playerid] = 150; ammo[playerid] = 50; PlayerInfo[giveplayerid][pGun2] = 22; PlayerInfo[giveplayerid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY,"Materiais insulficiente para Arma!"); return true; } }
else if(strcmp(x_weapon,"mp5",true) == 0) { if(PlayerInfo[playerid][pMats] > 199) { weapon[playerid] = 29; price[playerid] = 200; ammo[playerid] = 200; PlayerInfo[giveplayerid][pGun2] = 29; PlayerInfo[giveplayerid][pAmmo2] = 200; } else { SendClientMessage(playerid,COLOR_GREY,"Materiais insulficiente para Arma!"); return true; } }
else if(strcmp(x_weapon,"shotgun",true) == 0) { if(PlayerInfo[playerid][pMats] > 199) { weapon[playerid] = 25; price[playerid] = 200; ammo[playerid] = 50; PlayerInfo[giveplayerid][pGun2] = 25; PlayerInfo[giveplayerid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY,"Materiais insulficiente para Arma!"); return true; } }
//else if(strcmp(x_weapon,"spas12",true) == 0) { if(PlayerInfo[playerid][pMats] > 599) { weapon[playerid] = 27; price[playerid] = 600; ammo[playerid] = 50; PlayerInfo[giveplayerid][pGun2] = 27; PlayerInfo[giveplayerid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY,"Not enough Materials for that Weapon!"); return true; } }
else if(strcmp(x_weapon,"ak47",true) == 0) { if(PlayerInfo[playerid][pMats] > 599) { weapon[playerid] = 30; price[playerid] = 600; ammo[playerid] = 250; PlayerInfo[giveplayerid][pGun2] = 30; PlayerInfo[giveplayerid][pAmmo2] = 250; } else { SendClientMessage(playerid,COLOR_GREY," Vocк nгo tem Materiais para essa arma!"); return true; } }
else if(strcmp(x_weapon,"m4",true) == 0) { if(PlayerInfo[playerid][pMats] > 599) { weapon[playerid] = 31; price[playerid] = 600; ammo[playerid] = 250; PlayerInfo[giveplayerid][pGun2] = 31; PlayerInfo[giveplayerid][pAmmo2] = 250; } else { SendClientMessage(playerid,COLOR_GREY," Vocк nгo tem Materiais para essa arma!"); return true; } }
else if(strcmp(x_weapon,"rifle",true) == 0) { if(PlayerInfo[playerid][pMats] > 599) { weapon[playerid] = 33; price[playerid] = 600; ammo[playerid] = 50; PlayerInfo[giveplayerid][pGun2] = 33; PlayerInfo[giveplayerid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY,"Materiais insulficiente para Arma!"); return true; } }
else { SendClientMessage(playerid,COLOR_GREY,"Nome da arma invбlida!"); return true; }
if (ProxDetectorS(5.0,playerid,giveplayerid))
{
if(giveplayerid == playerid)
{
SendClientMessage(playerid,COLOR_GRAD1,"Vocк nгo estб numa loja de armas!");
return true;
}
if(PlayerInfo[playerid][pMiserPerk] > 0)
{
new skill = 2 * PlayerInfo[playerid][pMiserPerk];
new mats = price[playerid] / 100;
price[playerid] -= (mats)*(skill);
}
ConsumingMoney[playerid] = 1;
GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer));
GetPlayerName(playerid,sendername,sizeof(sendername));
format(string,sizeof(string),"Voce vendeu %s,um %s com %d ammo,para %d Materiais .",giveplayer,x_weapon,ammo[playerid],price[playerid]);
PlayerPlaySound(playerid,1052,0.0,0.0,0.0);
SendClientMessage(playerid,COLOR_GRAD1,string);
format(string,sizeof(string),"Vocк recebeu uma %s com %d a partir de muniзгo %s.",x_weapon,ammo[playerid],PlayerName(playerid));
SendClientMessage(giveplayerid,COLOR_GRAD1,string);
PlayerPlaySound(giveplayerid,1052,0.0,0.0,0.0);
format(string,sizeof(string),"* %s vendeu armas para %s.",sendername ,giveplayer);
ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GivePlayerWeapon(giveplayerid,weapon[playerid],ammo[playerid]);
PlayerInfo[playerid][pMats] -= price[playerid];
}
else
{
SendClientMessage(playerid,COLOR_GRAD1,"O cliente nao esta proximo de Vocк.");
return true;
}
}
else
{
format(string,sizeof(string),"%d nгo estб online.",giveplayerid);
SendClientMessage(playerid,COLOR_GRAD1,string);
}
}
return true;
}
enum pInfo
{
pEmprego
pJailed
};
PlayerInfo[playerid][pEmprego] = 0;
PlayerInfo[playerid][pJailed] = 0;
dcmd_venderarmas(playerid, params[])
{
if(Player[playerid][pJob] == VARMAS || Player[playerid][pMember] == TEAM_RUSSA || Player[playerid][pLeader] == TEAM_RUSSA || Player[playerid][pMember] == TEAM_YAKUZA || Player[playerid][pLeader] == TEAM_YAKUZA)
{
if(PlayerToPoint(40.0, playerid, 245.9469,75.8629,1003.6406)) return SendClientMessage(playerid, COLOR_WHITE, "[ERRO] Vocк nгo pode vender armas na DP! ");
new x_weapon[256],weapon[MAX_PLAYERS],ammo[MAX_PLAYERS],price[MAX_PLAYERS];
new tmp[24], idx; tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "[USO] /venderarmas [id/nick] [nome da arma]");
SendClientMessage(playerid, COLOR_GREY, "Armas: flores(25) sdpistol(100) eagle(150) mp5(200) escopeta(200)");
SendClientMessage(playerid, COLOR_GREY, "Armas: ak47(600) m4(600) rifle (600) paraquedas (100)");
return 1;
}
new giveid = ReturnUser(tmp);
if(!IsPlayerConnected(giveid)) return SendClientMessage(playerid, COLOR_GREY,"Jogador nгo conectado.");
if(Treinando[giveid][0] > 0) return SendClientMessage(playerid,COLOR_RED,"[ERRO] Jogador estб treinando.");
if(Player[giveid][pExp] < 0) return SendClientMessage(playerid, COLOR_RED, "O jogador ainda nгo pode usar armas.");
x_weapon = strtok(params, idx);
if(!strlen(x_weapon))
{
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
SendClientMessage(playerid, COLOR_WHITE, "*** Vender de armas ***");
SendClientMessage(playerid, COLOR_GREY, "[USO] /venderarmas [id/nick] [nome da arma]");
SendClientMessage(playerid, COLOR_GREY, "Armas: flores(25) sdpistol(100) eagle(200) mp5(200) escopeta(200)");
SendClientMessage(playerid, COLOR_GREY, "Armas: ak47(600) m4(600) rifle(600) paraquedas (100) spray (50)");
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
return 1;
}
if(strcmp(x_weapon,"sdpistol", true) == 0) { if(Player[playerid][pMats] > 99) { weapon[playerid] = 23; price[playerid] = 100; ammo[playerid] = 50; Player[giveid][pGun2] = 23; Player[giveid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"flores", true) == 0) { if(Player[playerid][pMats] > 24) { weapon[playerid] = 14; price[playerid] = 25; ammo[playerid] = 1; Player[giveid][pGun1] = 14; Player[giveid][pAmmo1] = 1; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"eagle", true) == 0) { if(Player[playerid][pMats] > 199) { weapon[playerid] = 24; price[playerid] = 150; ammo[playerid] = 50; Player[giveid][pGun2] = 24; Player[giveid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"mp5", true) == 0) { if(Player[playerid][pMats] > 199) { weapon[playerid] = 29; price[playerid] = 200; ammo[playerid] = 200; Player[giveid][pGun2] = 29; Player[giveid][pAmmo2] = 200; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"escopeta", true) == 0) { if(Player[playerid][pMats] > 199) { weapon[playerid] = 25; price[playerid] = 200; ammo[playerid] = 50; Player[giveid][pGun2] = 25; Player[giveid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"ak47", true) == 0) { if(Player[playerid][pMats] > 599) { weapon[playerid] = 30; price[playerid] = 600; ammo[playerid] = 250; Player[giveid][pGun2] = 30; Player[giveid][pAmmo2] = 250; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"m4", true) == 0) { if(Player[playerid][pMats] > 599) { weapon[playerid] = 31; price[playerid] = 600; ammo[playerid] = 250; Player[giveid][pGun2] = 31; Player[giveid][pAmmo2] = 250; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"rifle", true) == 0) { if(Player[playerid][pMats] > 599) { weapon[playerid] = 33; price[playerid] = 600; ammo[playerid] = 50; Player[giveid][pGun2] = 33; Player[giveid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"paraquedas", true) == 0) { if(Player[playerid][pMats] > 99) { weapon[playerid] = 46; price[playerid] = 100; ammo[playerid] = 1; Player[giveid][pGun2] = 46; Player[giveid][pAmmo2] = 1; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else if(strcmp(x_weapon,"spray", true) == 0) { if(Player[playerid][pMats] > 20) { weapon[playerid] = 41; price[playerid] = 50; ammo[playerid] = 300; Player[giveid][pGun2] = 41; Player[giveid][pAmmo2] = 300; } else { SendClientMessage(playerid,COLOR_GREY," Materiais insuficientes para esta arma."); return 1; } }
else { SendClientMessage(playerid,COLOR_GREY," Nome inexistente."); return 1; }
if(ProxDetectorS(5.0, playerid, giveid))
{
if(giveid == playerid) return SendClientMessage(playerid, COLOR_RED, "[ERRO] Vocк nгo pode vender armas a vocк mesmo");
if(Player[playerid][pMiserPerk] > 0)
{
new skill = 2 * Player[playerid][pMiserPerk];
new mats = price[playerid] / 100;
price[playerid] -= (mats)*(skill);
}
ConsumingMoney[playerid] = 1;
format(thestring, sizeof(thestring), " Vocк deu a %s uma %s com %d municхes usando %d materiais.", Player[giveid][pName],x_weapon, ammo[playerid], price[playerid]);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GREY, thestring);
format(thestring, sizeof(thestring), " Vocк recebeu uma %s com %d de %s.", x_weapon, ammo[playerid], Player[playerid][pName]);
SendClientMessage(giveid, COLOR_GREY, thestring);
PlayerPlaySound(giveid, 1052, 0.0, 0.0, 0.0);
format(thestring, sizeof(thestring), "%s recebeu armas de %s.", Player[giveid][pName], Player[playerid][pName]);
ProxDetector(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new gunname[100];
GetWeaponName(weapon[playerid], gunname, sizeof(gunname));
format(thestring, sizeof(thestring), "%s vendeu uma %s para %s.", Player[playerid][pName], gunname,Player[giveid][pName]);
ProxDetector(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SafeGivePlayerWeapon(giveid,weapon[playerid],ammo[playerid]);
Player[playerid][pMats] -= price[playerid];
}
else { SendClientMessage(playerid, COLOR_RED,"[ERRO] Aproxime-se."); } }
else { SendClientMessage(playerid,COLOR_ORANGE,"Vocк nгo й um vendedor de armas."); }
return 1;
}
Tenta ai:
pawn Код:
|