SA-MP Forums Archive
Payday problem.. - 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: Payday problem.. (/showthread.php?tid=568039)



Payday problem.. - dundolina - 18.03.2015

Hello i add 2-3 payday systems and no one work. I wait for the round hour but when it's comes nothing happend. So i need Payday system - when player are in server for 1 hour gives him award or when player its in server about 20 minutes on the round hour gives him award. Please help me.


Re: Payday problem.. - JaKe Elite - 18.03.2015

This isn't a "Scripting Help, We give you codes 4 free, YES!"

We won't provide you any codes, Scripting Help meant to be a board for these scripters who are having problem on their own codes, not on "Give me plz a payday code plz".

Give us your code, Maybe we can work on it.


Re: Payday problem.. - dundolina - 18.03.2015

OnFilterScriptInIt

Код:
	SetTimer("payday", 60000, 1);
Код:
forward payday(playerid);
public payday(playerid)
{
    new hh, mm, ss;
    gettime( hh, mm, ss );//-> Gives at ??:00 -> every hour (10:00/11:00 and etc)

    if( mm == 0 )
    {
	    for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
	    {
			new string[128];
			new RandomPay = random(50000 - 10000) + 10000;// new RandomPay = random(MAX - MIN) + MIN;
			GivePlayerMoney( playerid, RandomPay );
		    SendClientMessage(playerid, COLOR_WHITE,"Look You recived a paycheck!");
		    format(string, sizeof(string), "You have recieve a check of $%i", RandomPay);
			SendClientMessage(i, COLOR_WHITE, string);
		    SendClientMessage(playerid, COLOR_WHITE,"-------------------------");
	    }
	}
    return 1;
}
I have this in my gamemode.


Re: Payday problem.. - JaKe Elite - 18.03.2015

Change this

PHP код:
if( mm == 
to

PHP код:
if( hh >= && mm == && ss == 
Hope it works


Re: Payday problem.. - Sew_Sumi - 18.03.2015

Quote:
Originally Posted by JaKe Elite
Посмотреть сообщение
Hope it works
Are you confident in that code actually working?

Код:
{
    new hh, mm, ss;
    gettime( hh, mm, ss );//-> Gives at ??:00 -> every hour (10:00/11:00 and etc)

    switch(mm)
    {
        case 0,20,40:
        {
			for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
			{
				new string[128];
				new RandomPay = random(50000 - 10000) + 10000;// new RandomPay = random(MAX - MIN) + MIN;
				GivePlayerMoney( playerid, RandomPay );
				SendClientMessage(playerid, COLOR_WHITE,"Look You recived a paycheck!");
				format(string, sizeof(string), "You have recieve a check of $%i", RandomPay);
				SendClientMessage(i, COLOR_WHITE, string);
				SendClientMessage(playerid, COLOR_WHITE,"-------------------------");
			}
		}
	}
    return 1;
}
Try that, that should do on the hour, 20 past, and 20 to...


Re: Payday problem.. - dundolina - 05.04.2015

Again dont work, dont give me award or something..


Re: Payday problem.. - Sithis - 05.04.2015

Be more specific. WHAT is not working? Is it not being called, don't you get the cash? Are you using a conflicting anti cheat maybe?


Re: Payday problem.. - dundolina - 05.04.2015

Umm dont give me message, cash for payday.I have anticheat but i'm sure the problem it's not there.


Re: Payday problem.. - dundolina - 22.04.2015

Help please?


Re: Payday problem.. - MRSAS - 22.04.2015

Code +REP

Код:
#include <a_samp>
#include <zcmd>

public OnFilterScriptInit()
{
	print (" MRSAS Payday ");
	return 1;
}

CMD:payday(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
		SendClientMessageToAll(0xffff, " RCON Admin Has Started A Payday And Gave All Players 5000+ Coins :)");
        for(new i; i<MAX_PLAYERS; i++)
        {
        GivePlayerMoney(playerid,5000);
        }
    }
    else
    {
	SendClientMessage(playerid, 0xffff, " You Must Be A Rcon Admin To Use This Command!");
    }
    return 1;
}
Warning: Must Be Logged In As A RCON Leader " /rcon login Password " Then Use This Command.