11.09.2013, 19:20
You can simply do:
Or in case you want a custom message instead of "SERVER: Unknown command", you can use:
pawn Код:
public OnPlayerCommandPerformed( playerid, cmdtext[ ], success )
{
if( !success )
{
for( new t = 0; t < sizeof( tInfo ); t++ )
{
if( !strcmp( cmdtext, tInfo[ i ][ tTele ], true ) )
{
// Teleport, give weapons etc..
break;
}
}
}
return 1;
}
pawn Код:
public OnPlayerCommandPerformed( playerid, cmdtext[ ], success )
{
if( !success )
{
new
bool: exists = false
;
for( new t = 0; t < sizeof( tInfo ); t++ )
{
if( !strcmp( cmdtext, tInfo[ i ][ tTele ], true ) )
{
// Teleport, give weapons etc..
exists = true;
break;
}
}
if( !exists ) SendClientMessage( playerid, 0xFF0000FF, "That command does not exist." );
}
return 1;
}