Command Help
#2

Why would you use sscanf with just one parameter?
pawn Код:
dcmd_land(playerid, params[])
{
   new ap, name[ MAX_PLAYER_NAME ];
   if( isnull( params ) ) return SendClientMessage( playerid, 0xFF0000AA, "USAGE: /land [ls/lv/sf]" );
   GetPlayerName( playerid, name, MAX_PLAYER_NAME );
   if( !strcmp( params, "ls", true ) )
   {
      // Landing at los santos
   }
   else if( !strcmp( params, "lv", true ) )
   {
      // Landing at las venturas
   }
   else if( !strcmp( params, "sf", true ) )
   {
      // Landing as san fierror
   }
   return 1;
}
And the original problem is caused because you return 0 at the end of command. You only need to do that in OnPlayerCommandText callback.
Reply


Messages In This Thread
Command Help - by wilko1995 - 01.01.2011, 12:30
Re: Command Help - by Grim_ - 01.01.2011, 12:42
Re: Command Help - by wilko1995 - 01.01.2011, 12:46
Re: Command Help - by Mean - 01.01.2011, 18:28
Re: Command Help - by wilko1995 - 01.01.2011, 22:52

Forum Jump:


Users browsing this thread: 6 Guest(s)