SA-MP Forums Archive
Problem with a 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: Problem with a command (/showthread.php?tid=581078)



Problem with a command - Lirbo - 10.07.2015

PHP код:
CMD:bag(playerid,params[]){
if(
sscanf(params,"s",TinyString)) return MSG(playerid,C_RED,"[ERROR] {ff7777}Usage: /Bag [Store/Take]");
if(
strcmp(TinyString,"store",true) && strcmp(TinyString,"take",true)) return MSG(playerid,C_RED,"[ERROR] {ff7777}Usage: /Bag [Store/Take]");
if(!
strcmp(TinyString"store",true)){
if(
sscanf(params,"ss",TinyStringTinyString2)) return MSG(playerid,C_RED,"[ERROR] {ff7777}Usage: /Bag [Store] [Weapon/Drug Name]");}
if(
strcmp(TinyString,"weapon",true) && strcmp(TinyString,"weed",true) && strcmp(TinyString,"cocaine",true) && strcmp(TinyString,"ecstasy",true) && strcmp(TinyString,"heroin",true)) return MSG(playerid,C_RED,"[ERROR] {ff7777}Usage: /Bag [Store] [Weapon/Drug Name]");
if(!
strcmp(TinyString"weapon",true)){
new 
pWep GetPlayerWeapon(playerid);
new 
pAmo GetPlayerAmmo(playerid);
format(String,sizeof(String),"W%s",pWep);
DOF2_SetInt(pFile(playerid),String,1);
format(String,sizeof(String),"B%s",pWep);
DOF2_SetInt(pFile(playerid),String,pAmo);
SetPlayerAmmo(playerid,pWep,0);}
return 
1;} 
when i type /bag store weapon it sends me "[ERROR] Usage: /Bag [Store/Take]"