12.07.2011, 09:40
Can someone make filescript money to score and /null reset cash ? thx
CMD:null(playerid, cmdtext[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetPlayerScore(i, 0);
SetPlayerMoney(i, 0);
}
return 1;
}
stock SetPlayerMoney(playerid, cash)
{
ResetPlayerMoney(playerid);
return GivePlayerMoney(playerid, cash);
}
/*
A quick filterscript
*/
#include < a_samp >
new
gTimer[ MAX_PLAYERS ]
;
public OnPlayerConnect( playerid )
{
gTimer[ playerid ] = SetTimerEx( "MoneyToScore", 1000, true, "i", playerid );
return 1;
}
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
if ( !strcmp( cmdtext, "/null", true ) )
return ResetPlayerMoney( playerid ), 1;
return 0;
}
forward MoneyToScore( playerid );
public MoneyToScore( playerid )
{
SetPlayerScore( playerid, GetPlayerMoney( playerid ) );
return 1;
}
pawn Код:
|
public OnGameModeInit()
{
SetTimer("Check", 1000, true);
return 1;
}
forward Check();
public Check()
{
for(new i= 0; i < MAX_PLAYERS; i ++) { SetPlayerScore(i, GetPlayerMoney(i)); }
return 1;
}