pawn Код:
CMD:venderarma(playerid, params [])
{
/* if(IsPlayerConnected(playerid))
/* if (PlayerInfo[playerid][pEmprego] != 9)
SendClientMessage(playerid,COLOR_GREY,"Voce nao e um Vendendor de Armas !");
return 1;
*/
/* giveplayerid = ReturnUser(tmp);
if (giveplayerid == playerid)
/* SendClientMessage(playerid,COLOR_GREY,"Voce nгo pode vender armas pra si mesmo!");
return 1;*/
new x_weapon[256],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) eagle(150) mp5(200) shotgun(200)");
SendClientMessage(playerid,COLOR_GREY,"Armas: rifle (600) ak47(600) m4(600)");
return 1;
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
if(giveplayerid != INVALID_PLAYER_ID)
x_weapon = strtok(cmdtext,idx);
if(!strlen(x_weapon))
SendClientMessage(playerid,COLOR_GREEN,"________________________________________________");
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)");
SendClientMessage(playerid,COLOR_GREEN,"________________________________________________");
return 1;
if(giveplayerid == playerid)
SendClientMessage(playerid,COLOR_GRAD1,"Voce nao esta numa loja de armas!");
return 1;
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),"Vocк 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],sendername);
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];
return 1;
}
achei esse comando, q й exatamente o que eu quero, porem, ta dando mais de 26 erros :\