31
General Discussion / Re: ( Awards & Archievments ) ( For All Scripters )
« on: March 23, 2014, 03:43:59 pm »
l o l
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
What do you want it to do, Matt? Could you please describe your code?
Is It Usefull? Or How Is This Usefull?
new pExp[MAX_PLAYERS]; // this variable is to Experience
new pTimeUP[MAX_PLAYERS]; // this variable is the time to get XP
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;
}
forward ProxDetectorS(Float:radi, playerid, targetid);
public ProxDetectorS(Float:radi, playerid, targetid)
{
if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
//radi = 2.0; //Trigger Radius
GetPlayerPos(targetid, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return true;
}
}
return 0;
}
if (ProxDetectorS(8.0, playerid, plr))
{
SendClientMessage(playerid, -1, "The player is near you!");
}
else
{
SendClientMessage(playerid, -1, " The character is far from You!");
return true;
}
F ired
A lone
I nternationally
L ost
FAIL!!!!
What The FUck Noob~
iTs WOrking And Also Tested In All Scripts! Noob Kind Of Dickhead!
why do not you put the timers together in a function?
eg.: Click Here
if It Is Neccessary? Edited