Need help
#1

Hey guys, I need help, first I have a error saying this.

pawn Код:
C:\Users\Michael\Desktop\samp03e_svr_win32\gamemodes\test.pwn(2009) : warning 204: symbol is assigned a value that is never used: "cash"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
Line 2009 is this code:

pawn Код:
new cash = PlayerInfo[playerid][pCash];
I don't get this problem, I need help. Didn't I do it correctly?


Full Code
pawn Код:
CMD:stats(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        new cash = PlayerInfo[playerid][pCash];
        new level = GetPlayerScore(playerid);
        new name[MAX_PLAYER_NAME], string[MAX_PLAYER_NAME];
        SendClientMessage(playerid, COLOR_LIME, "_______________________________________________");
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "[Account]: Name: [%s] Level: [%i]",name, level);
        SendClientMessage(playerid, COLOR_GRAD2, string);
    }
    return 1;
}
Reply
#2

Delete that line.

"new cash = PlayerInfo[playerid][pCash];" from command, you don't use that function in it.
Reply
#3

pawn Код:
CMD:stats( playerid, params[ ] )
{
    if( IsPlayerConnected( playerid ) )
    {
        new cash = PlayerInfo[ playerid ][ pCash ];
        new level = GetPlayerScore( playerid );
        new name[ MAX_PLAYER_NAME ], string[ MAX_PLAYER_NAME ];
        SendClientMessage( playerid, COLOR_LIME, "_______________" );
        GetPlayerName( playerid, name, sizeof( name ) );
        format( string, sizeof( string ), "[Account]: Name: [%s] Level: [%i] Cash: %d",name, level, cash ); //use cash here as well.
        SendClientMessage( playerid, COLOR_GRAD2, string );
    }
    return 1;
}
You can use it and if you don't want you can remove it.
Reply
#4

You created a new variable named "cash" two times. Just replace
pawn Код:
CMD:stats(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        new cash = PlayerInfo[playerid][pCash];
        new level = GetPlayerScore(playerid);
        new name[MAX_PLAYER_NAME], string[MAX_PLAYER_NAME];
        SendClientMessage(playerid, COLOR_LIME, "_______________________________________________");
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "[Account]: Name: [%s] Level: [%i]",name, level);
        SendClientMessage(playerid, COLOR_GRAD2, string);
    }
    return 1;
}
with this:
pawn Код:
CMD:stats(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        new level = GetPlayerScore(playerid);
        new name[MAX_PLAYER_NAME], string[MAX_PLAYER_NAME];
        SendClientMessage(playerid, COLOR_LIME, "_______________________________________________");
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "[Account]: Name: [%s] Level: [%i]",name, level);
        SendClientMessage(playerid, COLOR_GRAD2, string);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)