[AJUDA] Erro com o cmd /venderarma
#1

Galera fica dando erros,tb na linha cmd onde cria o comando /venderarma
esse comando peguei de um outro GM para colocar no meu GameModes.


O Comando:

Quote:

if(strcmp(cmd,"/VenderArma",true)==0)
{
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(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 1; } }
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 1; } }
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 1; } }
else if(strcmp(x_weapon,"eagle",true) == 0) { if(PlayerInfo[playerid][pMats] > 199) { weapon[playerid] = 24; price[playerid] = 150; ammo[playerid] = 50; PlayerInfo[giveplayerid][pGun2] = 24; PlayerInfo[giveplayerid][pAmmo2] = 50; } else { SendClientMessage(playerid,COLOR_GREY,"Materiais insulficiente para Arma!"); return 1; } }
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 1; } }
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 1; } }
//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 1; } }
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 1; } }
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 1; } }
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 1; } }
else { SendClientMessage(playerid,COLOR_GREY,"Nome da arma invбlida!"); return 1; }
if (ProxDetectorS(5.0,playerid,giveplayerid))
{
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(givep layer));
GetPlayerName(playerid,sendername,sizeof(sendernam e));
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,COL OR_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 voce.");
return 1;
}
}
else
{
format(string,sizeof(string),"%d nao esta online este player.",giveplayerid);
SendClientMessage(playerid,COLOR_GRAD1,string);
}
return 1;
{

Erros ao Copilar:

Quote:

C:\DOCUME~1\Lucas\MEUSDO~1\SAMP0~1.3B\FILTER~1\CAS A-A~1.PWN(353) : warning 217: loose indentation
C:\DOCUME~1\Lucas\MEUSDO~1\SAMP0~1.3B\FILTER~1\CAS A-A~1.PWN(353) : error 017: undefined symbol "cmd"
C:\DOCUME~1\Lucas\MEUSDO~1\SAMP0~1.3B\FILTER~1\CAS A-A~1.PWN(357) : error 017: undefined symbol "PlayerInfo"
C:\DOCUME~1\Lucas\MEUSDO~1\SAMP0~1.3B\FILTER~1\CAS A-A~1.PWN(357) : warning 215: expression has no effect
C:\DOCUME~1\Lucas\MEUSDO~1\SAMP0~1.3B\FILTER~1\CAS A-A~1.PWN(357) : error 001: expected token: ";", but found "]"
C:\DOCUME~1\Lucas\MEUSDO~1\SAMP0~1.3B\FILTER~1\CAS A-A~1.PWN(357) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Lucas\MEUSDO~1\SAMP0~1.3B\FILTER~1\CAS A-A~1.PWN(357) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.

Reply
#2

bota em [pawn] [/* pawn]
Reply
#3

C:\DOCUME~1\Lucas\MEUSDO~1\SAMP0~1.3B\FILTER~1\CAS A-A~1.PWN(353) : error 017: undefined symbol "cmd"
C:\DOCUME~1\Lucas\MEUSDO~1\SAMP0~1.3B\FILTER~1\CAS A-A~1.PWN(357) : error 017: undefined symbol "PlayerInfo"

Simples, define o "PlayerInfo" e "Cmd" (Vai no qual vc pegou o cуdigo, digita ctrl + f e procurar pela palavra, depois copia pro seu mode...)

Dica do dia:

1- God Father nгo da futuro
2- Nгo copie scripts dos outros, tente fazer o seu!

Abraзos
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)