25.09.2011, 09:39
Hey Guys!!! how to create the command 1 score per minute
#include <a_samp> new GiveScoreTimer[MAX_PLAYERS]; public OnPlayerConnect(playerid) { GiveScoreTimer[playerid] = SetTimerEx ("GivePlayerScore", 1000*60, true, "d", playerid); return 1; } public OnPlayerDisconnect(playerid, reason) { KillTimer(GiveScoreTimer[playerid]); return 1; } forward GivePlayerScore(playerid); public GivePlayerScore(playerid) { SetPlayerScore(playerid, GetPlayerScore(playerid) + 1); return 1; } |
//On OnGameModeInit / OnFilterScriptInit
SetTimer("playerscore", 60000, true);
//Anywhere
forward playerscore();
public playerscore()
{
for(new x; x<MAX_PLAYERS; x++)
{
if(!IsPlayerConnect(x)) continue;
SetPlayerScore(x, GetPlayerScore(x) + 1);
}
return 1;
}
E:\Games\Rockstar Games\GTA San Andreas\SAMP\gamemodes\XS.pwn(60) : error 017: undefined symbol "IsPlayerConnect" |
IsPlayerConnected(x)
I added it on my gamemode and i got score every .. minute.
But when i disconnect I have 0 score again. How can i save it? |