[HELP]Command request - 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: [HELP]Command request (
/showthread.php?tid=326822)
[HELP]Command request -
3RoR - 18.03.2012
How to create a timer(min)for level ?
Y set a timer when a player play 250min on server then the server give's him a Level up 1+ ETC FOR ALL LEVELS(350,450,550ETCCCCCC)
Ex.
You have played 250minutes on server and you have a Level + (2)
You have played 350minutes on server and you have a Level + (3)
You have played 450minutes on server and you have a Level + (4)
Re: [HELP]Command request -
park4bmx - 18.03.2012
you will need A Global Player variable to stoer the players time in.
then load & save it every time the player joins becouse you cant just set the timer again just
OnPlayerConnect
i cannot show u and exmaple now :X dont have alot of time.
Example
pawn Код:
new PTimer[MAX_PLAYERS];//At the top so its global
//then SetTimerEx on 'OnPlayerConnect'
public OnPlayerConnect(playerid)
{
//Dont know what saving System you use so just load the ''PTimer''
SetTimerEx("AfterTime", PTimer[playerid], false, "i", playerid);
forward AfterTime(playerid);
public AfterTime(playerid)
{
//pLevel=+1;
//Change to your pLevel variable
return 1;
}
}
Then 'OnPlayerDisconnect' make sure to save the time.
public OnPlayerDisconnect(playerid)
{
//This is saved with 'Y_INI'
new name[MAX_PLAYER_NAME], file[128];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"/mRegistration/Settings/%s.txt",name);
INI_WriteInt(file,"ServerTime",PTimer[playerid]);
return 1;
}
Re: [HELP]Command request -
3RoR - 18.03.2012
Can you help me ?
Y will give you a server 50Slots plz :S
EDIT:y have a hosting..
EDIT AGAIN:y found a script for level can you fix me and give me the script fixed,
Quote:
pLevelSistem
forward Level();
SetTimer("Level",60000,true);
Public Level()
{
new i;
for(i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i))
PlayerInfo[pLevelSistem] ++;
if(PlayerInfo [pLevelSistem] == 1)
{
PlayerInfo[pExp] ++;
PlayerInfo[pLevelSistem] = 0;
ShowClientMesssage(i, COLOR_LIGHTBLUE, "Earned 1Exp for playing on server");
}
}
}
OnPlayerRegister
format(var, 128, "Vreme=%d\n",PlayerInfo[playerid][pLevelSistem]);fwrite(hFile, var);
OnPlayerUpdate
format(var, 128, "Vreme=%d\n",PlayerInfo[playerid][pLevelSistem]);fwrite(hFile, var);
OnPlayerLogin
if( strcmp( key , "Vreme" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevelSistem] = strval( val ); }
|
Re: [HELP]Command request -
3RoR - 19.03.2012
Can Help someone ?
Re: [HELP]Command request -
ReneG - 19.03.2012
This is the wrong thread if you're looking for scripters.
Re: [HELP]Command request -
3RoR - 19.03.2012
noo y just wanna help :@ :S
Re: [HELP]Command request -
RoleplayEditor - 19.03.2012
Who is Y Lol
Re: [HELP]Command request -
3RoR - 19.03.2012
fuck :@. lock...