VC:MP 0.3 > Snippet Showroom

Nice account info cmd

(1/1)

The_Lucifer:
Hello all!, I created an account info cmd, here it is


--- Code: ---else if ( strcmp( cmd, "!cuenta", true ) == 0 )
    {
new ip[ 24 ];
                GetPlayerIp( playerid, ip, 24 );
new level; level = GetPlayerAdminLevel(gPlayers[ playerid ] );
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
new kills, deaths; kills = dini_Int( file, "Kills" ), deaths = dini_Int( file, "Deaths" );
new Float:ratio=floatdiv(kills, deaths);
eFormatMessageSentToPlayer( playerid, 0xFF9724FF,"°Nick: %s °Nivel: %d °Estado: %s", gPlayers[ playerid ], level, StatusTag( level ) );
if ( GetPlayerState( playerid ) == 1 ) eFormatMessageSentToPlayer( playerid, 0xFF9724FF,"°ID: %s °Posicion: A pie.", playerid);//FOOT
    if ( GetPlayerState( playerid ) == 2 ) eFormatMessageSentToPlayer( playerid, 0xFF9724FF,"°ID: %s °Posicion: En auto (conductor)", playerid); //CAR_DRIVER
        if ( GetPlayerState( playerid ) == 3 ) eFormatMessageSentToPlayer( playerid, 0xFF9724FF,"°ID: %s °Posicion: En auto (passagero)", playerid); //CAR_PASSENGER
    if ( GetPlayerState( playerid ) == 7 ) eFormatMessageSentToPlayer( playerid, 0xFF9724FF,"°ID: %s °Posicion: Escojiendo Skin.", playerid); //CLASS_SELECTION
    eFormatMessageSentToPlayer( playerid, 0xFF9724FF,"°Ubicacion: %s", GetPlayerLocation( playerid ));
eFormatMessageSentToPlayer( playerid, 0xFF9724FF,"°Assesinatos: %d °Muertes: %d °Ratio: %.4f", kills, deaths, ratio );
eFormatMessageSentToPlayer( playerid, 0xFF9724FF,"°IP: %s",  ip );
return 1;
     }
--- End code ---
Any bugs? tell me!
And i almost forgot, if eFormatMessageSentToPlayer gives u error, change it to SendClientMessage
Thanks

NE.Restricted:
Changing to SendClientMessage will bugged your script and give warning. To fix replace it with one of your functions to send a formatted message.

The_Lucifer:
Okay yea, but on my script i have it with eFormatedMessageToPlayer (the one u gave me) and it gives me 0 warnings :D

NE.Restricted:
I know. eFormatMessageSentToAll(or SentToPlayer) is a different function from SendClientMessage(ToAll)

NeskWriter:
You should post all the functions included in your code.


--- Quote from: NE.Restricted ---For forum moderators: Change my name to NE.CrystalBlue
--- End quote ---
For fuck sake Res

Navigation

[0] Message Index

Go to full version