Account saving warning
#1

I know this is just a warning but when its something to do with account i just dont want there to be any bugs here is what i am getting.
Код:
C:\Users\GTA ONLY\Desktop\Server\Blank Gamemode\gamemodes\Blank.pwn(182) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Код:
{
    new
		CString[50];
    format(CString, sizeof(CString), "Player: %s(%d) has left the server!", pName(playerid), playerid);
    SendClientMessageToAll(COLOR_GREY, CString);

	new File[50]; format(File, sizeof(File), PFiles, pName(playerid));

	GetPlayerPos(playerid, PVar[playerid][pLastX], PVar[playerid][pLastY], PVar[playerid][pLastZ]);
	GetPlayerMoney(playerid, PVar[playerid][pMoney]); //line 182
	
	djSetInt		(File, "Kills", 	PVar[playerid][pKills]);
	djSetInt		(File, "Money", 	PVar[playerid][pMoney]);
	djSetInt		(File, "Deaths", 	PVar[playerid][pDeaths]);
	djSetInt		(File, "Level", 	PVar[playerid][pLevel]);
	djSetInt        (File, "Muted",     PVar[playerid][pMuted]);
	djSet           (File, "MutedReason", PVar[playerid][pMutedReason]);

	djSetFloat		(File, "LastX", 	PVar[playerid][pLastX]);
	djSetFloat		(File, "LastY", 	PVar[playerid][pLastY]);
	djSetFloat		(File, "LastZ", 	PVar[playerid][pLastZ]);
	return 1;
}
Reply
#2

You used 2 arguments for GetPlayerMoney function.
https://sampwiki.blast.hk/wiki/GetPlayerMoney

You can do:
pawn Код:
PVar[ playerid ][ pMoney ] = GetPlayerMoney( playerid );
Reply
#3

JUst trying that out.
Reply
#4

Show us were you load your PVars.
Reply
#5

Dont think ive done it right

Код:
//==============================================================================
// ON PLAYERSPAWN
//==============================================================================
public OnPlayerSpawn(playerid)
{
	if(PVar[playerid][pLastX] == 0.0 && PVar[playerid][pLastY] == 0.0)
	{
		new
		    RPos = random(sizeof(RandSpawns));
		    
		SetPlayerPos(playerid, RandSpawns[RPos][0], RandSpawns[RPos][1], RandSpawns[RPos][2]);
	}
	else SetPlayerPos(playerid, PVar[playerid][pLastX], PVar[playerid][pLastY], PVar[playerid][pLastZ]);
	return 1;
}
The money is saving now as i can see it in the user files but it doesnt give you the money when you log in again.
Reply
#6

pawn Код:
public OnPlayerSpawn(playerid)
{
    if( PVar[ playerid ][ pLastX ] == 0.0 && PVar[ playerid ][ pLastY ] == 0.0 )
    {
        new
            RPos = random( sizeof ( RandSpawns ) );
           
        SetPlayerPos( playerid, RandSpawns[ RPos ][ 0 ], RandSpawns[ RPos ][ 1 ], RandSpawns[ RPos ][ 2 ] );
    }
    else SetPlayerPos( playerid, PVar[ playerid ][ pLastX ], PVar[ playerid ][ pLastY ], PVar[ playerid ][ pLastZ ] );
    GivePlayerMoney( playerid, PVar[ playerid ][ pMoney ] ); // <----
    return 1;
}
Reply
#7

What you said didnt work as i posted the wrong thing but i added what you said and added to the dialog when your password is accepted and it worked great.

Many thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)