SA-MP Forums Archive
[HELP] Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] Command (/showthread.php?tid=445762)



[HELP] Command - shulk - 22.06.2013

Hello,

i need help about command, when i type /sellitems boxer/knife 0 i dont have boxer/knife only Message "Nepoznata komanda!"

Код:
CMD:sellitems(playerid, params[])
{
new s[128];
new id;
new boxer;
new knife;
if(PlayerInfo[playerid][pPosao] == 1)
   {
if(sscanf(params,"s[128]",s))
{
 SCM(playerid,SVJETLOPLAVA,"KORISTI: {FFFFFF}/sellitems [Opcija]");
 SCM(playerid,-1,"OPCIJE: boxer - knife");
 return 1;
}
if(!strcmp(s, "boxer", false))
{
   if(sscanf(params,"du",boxer,id)) return SCM(playerid,SVJETLOPLAVA,"KORISTI:{FFFFFF} /sellitems [Boxer/Knife] [ID]");
   GivePlayerWeapon(id, 1, 1);

}
else if(!strcmp(s,"knife", false))
{
   if(sscanf(params,"du",knife,id)) return SCM(playerid,SVJETLOPLAVA,"KORISTI:{FFFFFF} /sellitems [Boxer/Knife] [ID]");
   GivePlayerWeapon(id, 22, 22);
}

else {
 SCM(playerid,RED,"Nepoznata komanda!");
}

}
return 1;
}



Re: [HELP] Command - Admigo - 22.06.2013

Quote:
Originally Posted by shulk
Посмотреть сообщение
Hello,

i need help about command, when i type /sellitems boxer/knife 0 i dont have boxer/knife only Message "Nepoznata komanda!"

Код:
CMD:sellitems(playerid, params[])
{
new s[128];
new id;
new boxer;
new knife;
if(PlayerInfo[playerid][pPosao] == 1)
   {
if(sscanf(params,"s[128]",s))
{
 SCM(playerid,SVJETLOPLAVA,"KORISTI: {FFFFFF}/sellitems [Opcija]");
 SCM(playerid,-1,"OPCIJE: boxer - knife");
 return 1;
}
if(!strcmp(s, "boxer", false))
{
   if(sscanf(params,"du",boxer,id)) return SCM(playerid,SVJETLOPLAVA,"KORISTI:{FFFFFF} /sellitems [Boxer/Knife] [ID]");
   GivePlayerWeapon(id, 1, 1);

}
else if(!strcmp(s,"knife", false))
{
   if(sscanf(params,"du",knife,id)) return SCM(playerid,SVJETLOPLAVA,"KORISTI:{FFFFFF} /sellitems [Boxer/Knife] [ID]");
   GivePlayerWeapon(id, 22, 22);
}

else {
 SCM(playerid,RED,"Nepoznata komanda!");
}

}
return 1;
}
Change:
pawn Код:
if(!strcmp(s, "boxer", false))
else if(!strcmp(s,"knife", false))
to->
pawn Код:
if(!strcmp(s, "boxer", true))
else if(!strcmp(s,"knife", true))



Re: [HELP] Command - shulk - 23.06.2013

Dont work.


Re: [HELP] Command - IceBilizard - 23.06.2013

pawn Код:
if(!strcmp(cmd, "/boxer", true))
else if(!strcmp(cmd, "/knife", true))



Re: [HELP] Command - shulk - 23.06.2013

When i Compile, pawno stop work


Re: [HELP] Command - shulk - 23.06.2013

BUMP!