05.08.2011, 13:15
stock is a code to make functions.
It won't send " Symbol is unused "strtok" " if you use stock.
Example :
If you didn't use it, the compiler will sends a warning except if you use
With stock, you can still add it without using it, without any warnings.
Don't use timers or callbacks with stock, instead use forward( ); and public( )
I think wiki is enough.
& ( if you mean &&, scroll the page below ) signs means, you need to create it's own variable first, then use the function. Like :
About && sign, it means 'And'
Example:
A simple one.
Not really advanced, but hope this can help you.
( Im a noob too :P But hope this can help you )
It won't send " Symbol is unused "strtok" " if you use stock.
Example :
pawn Code:
strtok( ... )
{
return 1;
}
pawn Code:
#pragma unused strtok
pawn Code:
stock strtok( ... )
{
return 1;
}
pawn Code:
public OnGameModeInit( )
{
SetTimer( "gmx", 3000, true );
return 1;
}
stock gmx( ) // Wrong usage
return GameModeExit( );
forward gmx( ); public gmx( ) // Correct usage
return GameModeExit( );
& ( if you mean &&, scroll the page below ) signs means, you need to create it's own variable first, then use the function. Like :
pawn Code:
stock getName( playerid, &szName ) // idk, if it sends a error try &szName[ 24 ]
{
GetPlayerName( playerid, szName, sizeof ( szName ) );
return name; // forgot how to do this :P
}
// Somewhere
new
name[ 24 ]
;
getName( playerid, name );
print( "%s", name );
Example:
pawn Code:
if ( ( getPlayerName( playerid ) == "Basicz" ) && ( strlen( getPlayerName( playerid ) ) == strlen( "Basicz" ) ) ) { // blablabla } // if playername == basicz and strlen playername == strlen " basicz "
if ( isANoob( playerid ) && GetPlayerMoney( playerid ) < 3500 )
return Ban( playerid ); // if isanoob && getplayermoney < 3500
Not really advanced, but hope this can help you.
( Im a noob too :P But hope this can help you )