Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: MatheuS on March 18, 2014, 07:30:37 pm
-
Variable
new pExp[MAX_PLAYERS]; // this variable is to Experience
new pTimeUP[MAX_PLAYERS]; // this variable is the time to get XP
Function's
public OnPlayerConnect(playerid)
{
pExp[playerid] = GetPlayerExp(playerid);// takes the value of the line "Experience" in the player file
pTimeUP[playerid] = SetTimer("UpXP",60*60000,true);
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
SetPlayerExp(playerid,pExp[playerid]);
}
return 1;
}
stock UpXP(playerid)
{
pExp[playerid] ++;
new string[50];
format(string,sizeof(string),"[XP] Congratulations you just won XP on our server",pExp[playerid]);
SendClientMessage(playerid,-1,string);
return 1;
}
public SetPlayerExp(playerid,Exp)
{
format(INFO,256, REGISTERS, gPlayers[playerid]); //I created this in the WarChiefs, if you use another script just change
dini_IntSet(INFO,"EXP",Exp);
}
public GetPlayerExp(playerid)
{
format(INFO,256, REGISTERS, gPlayers[playerid]);
new exp; exp = dini_Int(INFO,"EXP");
return exp;
}
See an Error? post here
Thanks, I have helped :o
-
Is It Usefull? Or How Is This Usefull?
-
Is It Usefull? Or How Is This Usefull?
it serves to distract the players, the more time online, more xp, you can put money every level to rise