CMD:inv(playerid, params[])
{
new option[20];
if(isnull(params))
{
return cmd_inventory(playerid, params);
}
if(!strcmp(option, "use", true))
{
new invid;
if(sscanf(params, "i", invid))
{
if (invid == 1)
{
SendClientMessage(playerid, USAGE, "1 Working.");
}
if (invid == 2)
{
SendClientMessage(playerid, USAGE, "2 Working.");
}
}
return 1;
}
if(!strcmp(option, "usetool", true))
{
return 1;
}
return 1;
}
sscanf(params, "S(NULL)[20]I(0)", option, invid);
CMD:inv(playerid, params[])
{
new option[20];
if(isnull(params))
{
return cmd_inventory(playerid, params);
}
if(!strcmp(option, "use", true))
{
new invid;
if(!sscanf(params, "i", invid))
{
if (invid == 1)
{
SendClientMessage(playerid, USAGE, "1 Working.");
}
if (invid == 2)
{
SendClientMessage(playerid, USAGE, "2 Working.");
}
}
return 1;
}
if(!strcmp(option, "usetool", true))
{
return 1;
}
return 1;
}
CMD:inv(playerid, params[])
{
new option[20];
if(isnull(params))
{
return cmd_inventory(playerid, params);
}
if(strcmp(option, "use", true) == 0) // <-- This edited
{
new invid;
if(sscanf(params, "i", invid))
{
if (invid == 1)
{
SendClientMessage(playerid, USAGE, "1 Working.");
}
if (invid == 2)
{
SendClientMessage(playerid, USAGE, "2 Working.");
}
}
return 1;
}
if(!strcmp(option, "usetool", true))
{
return 1;
}
return 1;
}
try this, I am not sure though...
[pawn] if(strcmp(option, "use", true) == 0) // <-- This edited |
if( !IsPlayerInAnyVehicle( playerid ) )
if( IsPlayerInAnyVehicle( playerid ) == 0 )
CMD:inv( playerid, params[ ] ) { if( isnull( params ) ) return cmd_inventory( playerid, params ); if( !strcmp( params, "use", true ) ) { new lsTMP[ 4 ], invid; if( !sscanf( params, "s[4]i", lsTMP, invid ) ) { switch( invid ) { case 1: SendClientMessage( playerid, USAGE, "1 Working." ); case 2: SendClientMessage( playerid, USAGE, "2 Working." ); } } return 1; } if( !strcmp( params, "usetool", true ) ) { return 1; } return 1; }