Account saving warning - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Account saving warning (
/showthread.php?tid=290281)
Account saving warning -
manchestera - 15.10.2011
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;
}
Re: Account saving warning -
SmiT - 15.10.2011
You used 2 arguments for GetPlayerMoney function.
https://sampwiki.blast.hk/wiki/GetPlayerMoney
You can do:
pawn Код:
PVar[ playerid ][ pMoney ] = GetPlayerMoney( playerid );
Re: Account saving warning -
manchestera - 15.10.2011
JUst trying that out.
Re: Account saving warning -
SmiT - 15.10.2011
Show us were you load your PVars.
Re: Account saving warning -
manchestera - 15.10.2011
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.
Re: Account saving warning -
SmiT - 15.10.2011
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;
}
Re: Account saving warning -
manchestera - 15.10.2011
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.