Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //==============================================================================
- #include <a_samp>
- //==============================================================================
- // Red
- #define COLOR_DARKRED 0x660000AA
- #define COLOR_LIGHTRED 0xFF99AADD
- // Blue
- #define COLOR_SWAT_BLUE 0x0000FFAA
- #define COLOR_NEUTRALBLUE 0xABCDEF01
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_BLUE 0x0000BBAA
- #define COLOR_VIOLET 0x9955DEEE
- #define COLOR_LIGHTCYAN 0xAAFFCC33
- // Green
- #define COLOR_LIGHTGREEN 0x24FF0AB9
- #define COLOR_SEAGREEN 0x00EEADDF
- #define COLOR_GREEN 0x33AA33AA
- // Other
- #define COLOR_PINK 0xFF66FFAA
- #define COLOR_PURPLE 0x800080AA
- #define COLOR_NEUTRAL 0xABCDEF97
- #define COLOR_GLOBAL 0xD0D0FFAA
- // Rainbow
- #define COLOR_RED 0xFF0000AA
- #define COLOR_ORANGE 0xFF9900AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_BLUE 0x0000BBAA
- #define COLOR_VIOLET 0x9955DEEE
- // Black - White
- #define COLOR_WHITE 0xFFFFFF00
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_BLACK 0x000000AA
- //==============================================================================
- stock GetName ( playerid )
- {
- new Name [ MAX_PLAYER_NAME ];
- GetPlayerName ( playerid , Name , sizeof ( Name ) );
- return Name ;
- }
- //==============================================================================
- stock SendClientMessageToAllExcept ( playerid , COLOR , string [ ] )
- {
- for ( new giveplayerid = 0 ; giveplayerid < MAX_PLAYERS ; giveplayerid ++ )
- {
- if ( IsPlayerConnected ( playerid ) )
- {
- if( giveplayerid != playerid )
- {
- SendClientMessage ( giveplayerid , COLOR , string );
- }
- }
- }
- }
- //==============================================================================
- new Muted [ MAX_PLAYERS ];
- //==============================================================================
- public OnPlayerConnect ( playerid )
- {
- Muted [ playerid ] = 0;
- return 1;
- }
- //==============================================================================
- public OnPlayerDisconnect ( playerid )
- {
- Muted [ playerid ] = 0;
- return 1;
- }
- //==============================================================================
- public OnPlayerText ( playerid , text [ ] )
- {
- if ( Muted [ playerid ] == 1 )
- {
- return 0;
- }
- return 1;
- }
- //==============================================================================
- public OnPlayerCommandText ( playerid , cmdtext [ ] )
- {
- new string [ 256 ] , cmd [ 256 ] , idx ;
- cmd = strtok ( cmdtext , idx );
- if ( strcmp ( cmd , "/report" , true ) == 0 )
- {
- new tmp [ 256 ];
- tmp = strtok ( cmdtext , idx );
- if ( ! strlen ( tmp ) )
- {
- SendClientMessage ( playerid , COLOR_WHITE , "USAGE: /report [playerid] [reason]" );
- return 1;
- }
- new giveplayerid = strval ( tmp );
- tmp = strtok ( cmdtext , idx );
- if ( ! strlen ( tmp ) )
- {
- SendClientMessage ( playerid , COLOR_WHITE , "USAGE: /report [playerid] [reason]" );
- return 1;
- }
- new message [ 256 ];
- if ( giveplayerid < 10 )
- {
- strmid ( message , cmdtext , 10 , strlen ( cmdtext ) );
- }
- else
- {
- strmid ( message , cmdtext , 11 , strlen ( cmdtext ) );
- }
- if ( IsPlayerConnected ( giveplayerid ) )
- {
- SendClientMessage(playerid,COLOR_GREEN,"Report sent to all online admins");
- format(string, sizeof(string), "<report> %s (ID: %d) has accused %s (ID: %d) of %s!",GetName ( playerid ) , playerid , GetName ( giveplayerid ) , giveplayerid ,message);
- printf(string);
- for ( new giveplayerid2 = 0; giveplayerid2 < MAX_PLAYERS; giveplayerid2 ++ )
- {
- if ( IsPlayerAdmin ( giveplayerid2 ) )
- {
- SendClientMessage ( giveplayerid2 , COLOR_RED , "_______________________________________________________________" );
- format ( string , sizeof ( string ) , "<report> %s (ID: %d) has accused %s (ID: %d)",GetName ( playerid ) , playerid , GetName ( giveplayerid ) , giveplayerid );
- SendClientMessage ( giveplayerid2 , COLOR_WHITE , string );
- format ( string , sizeof ( string ) , "of %s!" , message );
- SendClientMessage ( giveplayerid2 , COLOR_WHITE , string);
- SendClientMessage ( giveplayerid2 , COLOR_RED , "_______________________________________________________________" );
- }
- }
- }
- else
- {
- format(string, sizeof(string), "[ERROR] id %d is not an active player.",giveplayerid);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- return 1;
- }
- if ( strcmp ( cmd , "/givemoney" , true ) == 0 && IsPlayerAdmin ( playerid ) )
- {
- new tmp [ 256 ];
- tmp = strtok ( cmdtext , idx );
- if( ! strlen ( tmp ) )
- {
- SendClientMessage ( playerid , COLOR_WHITE , "USAGE: '/givemoney [playerid] [amount]'." );
- return 1;
- }
- new giveplayerid = strval ( tmp );
- tmp = strtok ( cmdtext , idx );
- if( ! strlen ( tmp ) )
- {
- SendClientMessage ( playerid , COLOR_WHITE , "USAGE: '/givemoney [playerid] [amount]'." );
- return 1;
- }
- new moneys = strval ( tmp );
- if ( IsPlayerConnected ( giveplayerid ) )
- {
- GivePlayerMoney ( giveplayerid , moneys );
- format ( string , sizeof ( string ) , "[ADMIN MONEY] You have recieved $%d from %s!" , moneys , GetName ( playerid ) );
- SendClientMessage ( giveplayerid , COLOR_WHITE , string );
- format ( string , sizeof ( string ) , "[ADMIN MONEY] %s ( playerid : %d ) has transfered $%d to %s ( playerid : %d )." , GetName(playerid) , playerid , moneys , GetName( giveplayerid ) , giveplayerid );
- SendClientMessageToAllExcept ( giveplayerid , COLOR_WHITE , string );
- printf ( string );
- }
- else
- {
- format( string , sizeof ( string ) , "[ERROR] id %d is not an active player.", giveplayerid );
- SendClientMessage ( playerid , COLOR_WHITE , string );
- }
- return 1;
- }
- if ( strcmp ( cmd , "/goto" , true ) == 0 && IsPlayerAdmin ( playerid ) )
- {
- new tmp [ 256 ];
- tmp = strtok ( cmdtext , idx );
- if( ! strlen ( tmp ) )
- {
- SendClientMessage(playerid, COLOR_ORANGE, "Usage: /goto [Player ID]");
- return 1;
- }
- new giveplayerid = strval ( tmp );
- if ( ! IsPlayerConnected ( giveplayerid ) )
- {
- format(string, sizeof(string), "[ERROR] id %d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_WHITE, string);
- return 1;
- }
- new Float:X, Float:Y, Float:Z;
- if ( ! IsPlayerInAnyVehicle ( playerid ) || GetPlayerInterior ( giveplayerid ) != 0 )
- {
- GetPlayerPos ( giveplayerid , X , Y ,Z );
- SetPlayerPos ( playerid , X , Y + 0.5 , Z+1 );
- SetPlayerInterior ( playerid , GetPlayerInterior ( giveplayerid ) );
- format ( string , sizeof ( string ) , "[GOTO] %s ( playerid: %d ) has teleported to you. ", GetName ( playerid ) , playerid );
- SendClientMessage ( giveplayerid , COLOR_WHITE , string );
- format ( string , sizeof ( string ) , "[GOTO] you have teleported to %s ( playerid: %d ). ", GetName ( giveplayerid ) , giveplayerid );
- SendClientMessage ( playerid , COLOR_WHITE , string );
- return 1;
- }
- else
- {
- new VehicleID = GetPlayerVehicleID ( playerid );
- GetPlayerPos ( giveplayerid , X , Y ,Z );
- SetVehiclePos ( VehicleID , X , Y + 0.5 , Z+1 );
- SetPlayerInterior ( playerid , GetPlayerInterior ( giveplayerid ) );
- format ( string , sizeof ( string ) , "[GOTO] %s ( playerid: %d ) has teleported to you. ", GetName ( playerid ) , playerid );
- SendClientMessage ( giveplayerid , COLOR_WHITE , string );
- format ( string , sizeof ( string ) , "[GOTO] you have teleported to %s ( playerid: %d ). ", GetName ( giveplayerid ) , giveplayerid );
- SendClientMessage ( playerid , COLOR_WHITE , string );
- return 1;
- }
- }
- if ( strcmp ( cmd , "/get" , true ) == 0 && IsPlayerAdmin ( playerid ) )
- {
- new tmp [ 256 ];
- tmp = strtok ( cmdtext , idx );
- if( ! strlen ( tmp ) )
- {
- SendClientMessage(playerid, COLOR_ORANGE, "Usage: /get [Player ID]");
- return 1;
- }
- new giveplayerid = strval ( tmp );
- if ( ! IsPlayerConnected ( giveplayerid ) )
- {
- format(string, sizeof(string), "[ERROR] id %d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_WHITE, string);
- return 1;
- }
- new Float:X, Float:Y, Float:Z;
- if ( ! IsPlayerInAnyVehicle ( giveplayerid ) )
- {
- GetPlayerPos ( playerid , X , Y ,Z );
- SetPlayerPos ( giveplayerid , X , Y + 0.5 , Z+1 );
- SetPlayerInterior ( giveplayerid , GetPlayerInterior ( playerid ) );
- format ( string , sizeof ( string ) , "[GET] you have been teleported to %s ( playerid: %d ).", GetName ( playerid ) , playerid );
- SendClientMessage ( giveplayerid , COLOR_WHITE , string );
- format ( string , sizeof ( string ) , "[GET] you have teleported %s to you" , GetName ( giveplayerid ) );
- SendClientMessage ( playerid , COLOR_WHITE , string );
- return 1;
- }
- else
- {
- new VehicleID = GetPlayerVehicleID ( giveplayerid );
- GetPlayerPos ( playerid , X , Y ,Z );
- SetVehiclePos ( VehicleID , X , Y + 0.5 , Z+1 );
- SetPlayerInterior ( giveplayerid , GetPlayerInterior ( playerid ) );
- format ( string , sizeof ( string ) , "[GET] you have been teleported to %s ( playerid: %d ).", GetName ( playerid ) , playerid );
- SendClientMessage ( giveplayerid , COLOR_WHITE , string );
- format ( string , sizeof ( string ) , "[GET] you have teleported %s to you" , GetName ( giveplayerid ) );
- SendClientMessage ( playerid , COLOR_WHITE , string );
- return 1;
- }
- }
- if ( strcmp ( cmd , "/an" , true ) == 0 && IsPlayerAdmin ( playerid ) )
- {
- new tmp [ 256 ];
- tmp = strtok ( cmdtext , idx );
- if ( !strlen ( tmp ) )
- {
- SendClientMessage ( playerid , COLOR_WHITE , "[ERROR]: USAGE: '/an [time (seconds)] [Message]'" );
- return 1;
- }
- new input = strval ( tmp );
- new Message [ 256 ];
- if ( input < 10 )
- {
- strmid ( Message , cmdtext , 5 , strlen ( cmdtext ) );
- }
- if ( input >= 10 && input <= 60 )
- {
- strmid ( Message , cmdtext , 6 , strlen ( cmdtext ) );
- }
- if ( input > 60 )
- {
- SendClientMessage ( playerid , COLOR_WHITE , "[ERROR]: Time cannot be over 60 seconds!" );
- return 1;
- }
- new time = floatround ( input * 1000 );
- if ( !strlen ( Message ) )
- {
- SendClientMessage ( playerid , COLOR_WHITE , "[ERROR]: USAGE: '/an [time (seconds)] [Message]'" );
- return 1;
- }
- format ( string , sizeof ( string ) , "%s" , Message );
- GameTextForAll ( string , time , 6 );
- printf ( "[announce] %s ( playerid: %d ) : %s" , GetName ( playerid ) , playerid , Message );
- return 1;
- }
- if ( strcmp ( cmd , "/freeze" , true ) == 0 && IsPlayerAdmin ( playerid ) )
- {
- new tmp [ 256 ];
- tmp = strtok ( cmdtext , idx );
- if ( !strlen ( tmp ) )
- {
- SendClientMessage ( playerid , COLOR_WHITE , "Usage: /freeze [Player ID]" );
- return 1;
- }
- new giveplayerid = strval ( tmp );
- if ( ! IsPlayerConnected ( giveplayerid ) )
- {
- format(string, sizeof(string), "[ERROR] id %d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_WHITE, string);
- return 1;
- }
- TogglePlayerControllable ( giveplayerid , false );
- format ( string , sizeof ( string ) , "%s (player: %d) has frozen %s ( playerid: %d ). ", GetName ( playerid ) , playerid, GetName ( giveplayerid ) , giveplayerid );
- SendClientMessageToAllExcept ( giveplayerid , COLOR_YELLOW , string );
- printf ( string );
- format ( string , sizeof ( string ) , "[WARNING] You have been frozen by %s ( playerid: %d ). ", GetName ( playerid ) , playerid );
- SendClientMessage ( giveplayerid , COLOR_WHITE , string );
- return 1;
- }
- if(strcmp(cmd, "/mute", true) == 0 && IsPlayerAdmin ( playerid ) )
- {
- new tmp [ 256 ];
- tmp = strtok ( cmdtext , idx );
- if ( !strlen ( tmp ) )
- {
- SendClientMessage ( playerid , COLOR_WHITE , "Usage: /mute [Player ID]" );
- return 1;
- }
- new giveplayerid = strval(tmp);
- if ( ! IsPlayerConnected ( giveplayerid ) )
- {
- format(string, sizeof(string), "[ERROR] id %d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_WHITE, string);
- return 1;
- }
- Muted [ giveplayerid ] = 1;
- format ( string , sizeof ( string ) , "%s (player: %d) has muted %s ( playerid: %d ). ", GetName ( playerid ) , playerid, GetName ( giveplayerid ) , giveplayerid );
- SendClientMessageToAllExcept ( giveplayerid , COLOR_YELLOW , string );
- printf ( string );
- format ( string , sizeof ( string ) , "[WARNING] You have been muted by %s ( playerid: %d ). ", GetName ( playerid ) , playerid );
- SendClientMessage ( giveplayerid , COLOR_WHITE , string );
- return 1;
- }
- if ( strcmp ( cmd , "/unfreeze" , true ) == 0 && IsPlayerAdmin ( playerid ) )
- {
- new tmp [ 256 ];
- tmp = strtok ( cmdtext , idx );
- if ( !strlen ( tmp ) )
- {
- SendClientMessage ( playerid , COLOR_WHITE , "Usage: /unfreeze [Player ID]" );
- return 1;
- }
- new giveplayerid = strval ( tmp );
- if ( ! IsPlayerConnected ( giveplayerid ) )
- {
- format(string, sizeof(string), "[ERROR] id %d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_WHITE, string);
- return 1;
- }
- TogglePlayerControllable ( giveplayerid , true );
- format ( string , sizeof ( string ) , "%s (player: %d) has unfrozen %s ( playerid: %d ). ", GetName ( playerid ) , playerid, GetName ( giveplayerid ) , giveplayerid );
- SendClientMessageToAllExcept ( giveplayerid , COLOR_YELLOW , string );
- printf ( string );
- format ( string , sizeof ( string ) , "[UNFREEZE] You have been unfrozen by %s ( playerid: %d ). ", GetName ( playerid ) , playerid );
- SendClientMessage ( giveplayerid , COLOR_WHITE , string );
- return 1;
- }
- if(strcmp(cmd, "/unmute", true) == 0 && IsPlayerAdmin ( playerid ) )
- {
- new tmp [ 256 ];
- tmp = strtok ( cmdtext , idx );
- if ( !strlen ( tmp ) )
- {
- SendClientMessage ( playerid , COLOR_WHITE , "Usage: /unmute [Player ID]" );
- return 1;
- }
- new giveplayerid = strval(tmp);
- if ( ! IsPlayerConnected ( giveplayerid ) )
- {
- format(string, sizeof(string), "[ERROR] id %d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_WHITE, string);
- return 1;
- }
- Muted [ giveplayerid ] = 0;
- format ( string , sizeof ( string ) , "%s (player: %d) has un-muted %s ( playerid: %d ). ", GetName ( playerid ) , playerid, GetName ( giveplayerid ) , giveplayerid );
- SendClientMessageToAllExcept ( giveplayerid , COLOR_YELLOW , string );
- printf ( string );
- format ( string , sizeof ( string ) , "[UNMUTE] You have been un-muted by %s ( playerid: %d ). ", GetName ( playerid ) , playerid );
- SendClientMessage ( giveplayerid , COLOR_WHITE , string );
- return 1;
- }
- if ( strcmp ( cmd , "/kick" , true ) == 0 && IsPlayerAdmin ( playerid ) )
- {
- new tmp [ 256 ];
- new message [ 256 ];
- tmp = strtok ( cmdtext , idx );
- if( ! strlen ( tmp ) )
- {
- SendClientMessage ( playerid , COLOR_WHITE , "USAGE: /kick [playerid]" );
- return 1;
- }
- new giveplayerid = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- if (IsPlayerConnected(giveplayerid))
- {
- SendClientMessageToAll(COLOR_RED,"____________________________________________________________________________________");
- format(string, sizeof(string), "Admin %s (player: %d) has Kicked %s (player: %d) from the server.",GetName(playerid), playerid, GetName(giveplayerid), giveplayerid);
- SendClientMessageToAll(COLOR_WHITE, string);
- printf(string);
- SendClientMessageToAll(COLOR_WHITE,"No reason given.");
- printf(string);
- SendClientMessageToAll(COLOR_RED,"____________________________________________________________________________________");
- Kick(giveplayerid);
- return 1;
- }
- else
- {
- format(string, sizeof(string), "[ERROR] ID %d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_WHITE, string);
- return 1;
- }
- }
- if(giveplayerid < 10)
- {
- strmid(message, cmdtext, 7, strlen(cmdtext));
- }
- else
- {
- strmid(message, cmdtext, 8, strlen(cmdtext));
- }
- if (IsPlayerConnected(giveplayerid))
- {
- SendClientMessageToAll(COLOR_RED,"____________________________________________________________________________________");
- format(string, sizeof(string), "Admin %s (player: %d) has Kicked %s (player: %d) from the server.",GetName(playerid), playerid, GetName(giveplayerid), giveplayerid);
- SendClientMessageToAll(COLOR_WHITE, string);
- printf(string);
- format(string, sizeof(string), "reason: %s.",message);
- SendClientMessageToAll(COLOR_WHITE, string);
- printf(string);
- SendClientMessageToAll(COLOR_RED,"____________________________________________________________________________________");
- Kick(giveplayerid);
- return 1;
- }
- else
- {
- format(string, sizeof(string), "[ERROR] ID %d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_WHITE, string);
- return 1;
- }
- }
- if ( strcmp ( cmd , "/admincommands" , true ) == 0 && IsPlayerAdmin ( playerid ) )
- {
- SendClientMessage ( playerid , COLOR_LIGHTBLUE , "/freeze [id] /unfreeze [id]." );
- SendClientMessage ( playerid , COLOR_LIGHTBLUE , "/mute [id] /unmute [id]." );
- SendClientMessage ( playerid , COLOR_LIGHTBLUE , "/an [time] [message] : to announce a message." );
- SendClientMessage ( playerid , COLOR_LIGHTBLUE , "/disarm [id] : to disarm someone." );
- SendClientMessage ( playerid , COLOR_LIGHTBLUE , "/kick [id] [reason] : to kick a player." );
- SendClientMessage ( playerid , COLOR_LIGHTBLUE , "/goto [id] : to teleport to a player." );
- SendClientMessage ( playerid , COLOR_LIGHTBLUE , "/get [id] : to bring a player to you." );
- SendClientMessage ( playerid , COLOR_LIGHTBLUE , "/Ban [id] [reason] : to Ban a player." );
- SendClientMessage ( playerid , COLOR_LIGHTBLUE , "/name [id] [name] : to change a players name." );
- SendClientMessage ( playerid , COLOR_LIGHTBLUE , "/givemoney [id] : to give money ( your money stays the same )." );
- return 1;
- }
- if ( strcmp ( cmd , "/ban" , true ) == 0 && IsPlayerAdmin ( playerid ) )
- {
- new tmp [ 256 ];
- new message [ 256 ];
- tmp = strtok ( cmdtext , idx );
- if( ! strlen ( tmp ) )
- {
- SendClientMessage ( playerid , COLOR_WHITE , "USAGE: /ban [playerid]" );
- return 1;
- }
- new giveplayerid = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- if (IsPlayerConnected(giveplayerid))
- {
- SendClientMessageToAll(COLOR_RED,"____________________________________________________________________________________");
- format(string, sizeof(string), "Admin %s (player: %d) has banned %s (player: %d) from the server.",GetName(playerid), playerid, GetName(giveplayerid), giveplayerid);
- SendClientMessageToAll(COLOR_WHITE, string);
- printf(string);
- SendClientMessageToAll(COLOR_WHITE,"No reason given.");
- printf(string);
- SendClientMessageToAll(COLOR_RED,"____________________________________________________________________________________");
- Ban(giveplayerid);
- return 1;
- }
- else
- {
- format(string, sizeof(string), "[ERROR] ID %d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_WHITE, string);
- return 1;
- }
- }
- if(giveplayerid < 10)
- {
- strmid ( message , cmdtext , 6 , strlen ( cmdtext ) );
- }
- else
- {
- strmid ( message , cmdtext , 7 , strlen ( cmdtext ) );
- }
- if (IsPlayerConnected(giveplayerid))
- {
- SendClientMessageToAll(COLOR_RED,"____________________________________________________________________________________");
- format(string, sizeof(string), "Admin %s (player: %d) has banned %s (player: %d) from the server.",GetName(playerid), playerid, GetName(giveplayerid), giveplayerid);
- SendClientMessageToAll(COLOR_WHITE, string);
- printf(string);
- format(string, sizeof(string), "reason: %s.",message);
- SendClientMessageToAll(COLOR_WHITE, string);
- printf(string);
- SendClientMessageToAll(COLOR_RED,"____________________________________________________________________________________");
- Ban(giveplayerid);
- return 1;
- }
- else
- {
- format(string, sizeof(string), "[ERROR] ID %d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_WHITE, string);
- return 1;
- }
- }
- if ( strcmp ( cmd , "/name" , true ) == 0 && IsPlayerAdmin ( playerid ) )
- {
- new tmp [ 256 ];
- tmp = strtok ( cmdtext , idx );
- if ( !strlen ( tmp ) )
- {
- SendClientMessage ( playerid , COLOR_WHITE , "USAGE: /name [playerid] [new name]");
- return 1;
- }
- new giveplayerid = strval ( tmp );
- tmp = strtok ( cmdtext , idx );
- if ( !strlen ( tmp ) )
- {
- SendClientMessage ( playerid , COLOR_WHITE , "USAGE: /name [playerid] [new name]");
- return 1;
- }
- if ( IsPlayerConnected ( giveplayerid ) )
- {
- format ( string , sizeof ( string ) , "%s (ID: %d) has changed my name to %s." , GetName ( playerid ) , playerid , tmp );
- printf ( string ) ;
- SendPlayerMessageToAll ( giveplayerid , string );
- SetPlayerName ( giveplayerid , tmp );
- return 1;
- }
- else
- {
- format ( string , sizeof ( string ) , "[ERROR] ID %d is not an active player." , giveplayerid );
- SendClientMessage ( playerid , COLOR_WHITE , string );
- return 1;
- }
- }
- return 0;
- }
- //==============================================================================
- strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
- //==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement