10.09.2012, 18:43
If player has login for almost 15 minutes then Give him money $5000. Could you help me with this. Thanks!
MoneyTimer[MAX_PLAYERS];
OnPlayerConnect(playerid)
{
MoneyTimer[playerid]=SetTimerEx("GiveMoneyPl0x",15*3600,true,"d",playerid);
//...
}
forward public GiveMoneyPl0x(playerid);
public GiveMoneyPl0x(playerid)
{
GivePlayerMoney(playerid,5000);
}
public OnPlayerDissconect(playerid,reason)
{
KillTimer(MoneyTimer[playerid]);
//...
}
pawn Код:
|
dcmd_rep(playerid,params[])
{
new repID, repName[MAX_PLAYER_NAME],name[24],str[128],str1[128];
if(reptimer[playerid] > 0) return SendClientMessage(playerid, white,"{FF0000}You have already gave someone a rep. Please wait before using it again");
if(sscanf(params,"u",repID)) return SendClientMessage(playerid, white,"{FFFF00}Usage: /rep [PlayerID]");
if(!IsPlayerConnected(repID)) return SendClientMessage(playerid, white,"{FF0000}>>Player is not online");
if(repID == playerid) return SendClientMessage(playerid, white,"{FF0000}>> You can't give yourself a reputation");
PlayerInfo[repID][Reps]++;
reptimer[playerid] = SetTimerEx("reptimer1",1200000,true,"i",playerid);
GetPlayerName(playerid,name,24);
GetPlayerName(repID,repName,sizeof(repName));
format(str,sizeof(str),"%s(%d) has gave 1 reputation point to you.",name,playerid);
SendClientMessage(repID,green,str);
format(str1,sizeof(str1),"You have gave %s(%d) 1 reputation point.",repName,repID);
SendClientMessage(playerid,green,str1);
return 1;
}