SA-MP Forums Archive
Ah Help With "Timed Public" - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Ah Help With "Timed Public" (/showthread.php?tid=171634)



Ah Help With "Timed Public" - Matthew_Johnston - 27.08.2010

Allo Guys, Well I Have a Payday Script Not exactly Working.. Its all working except, In My
public payday;

Playerid is Not recognised, I bet this is really simple except Search has done nothin for me
please help

code
public paycheck()
{
SendClientMessageToAll(0xFFFF00AA, "---------------------------------------");
SendClientMessageToAll(0xFFFF00AA, "San Andreas Bank.");
SendClientMessageToAll(0xFFFF00AA, "Las Venturas Citezen Paycheck of 250$");
SendClientMessageToAll(0xFFFF00AA, "---------------------------------------");
GivePlayerMoney(playerid, 250);
return 1;
}


Re: Ah Help With "Timed Public" - Jochemd - 27.08.2010

Code please.


Re: Ah Help With "Timed Public" - Matthew_Johnston - 27.08.2010

Code Added*


Re: Ah Help With "Timed Public" - Hiddos - 27.08.2010

I smell that you're doing SetTimer() instead of SetTimerEx()

Edit: Loop through all players (for(new playerid; playerid < MAX_PLAYERS; playerid++))


Re: Ah Help With "Timed Public" - Jochemd - 27.08.2010

pawn Код:
forward paycheck(playerid);
pawn Код:
SetTimerEx("paycheck",20000,1,"i",playerid);
pawn Код:
public paycheck(playerid)
{
//text here
return 1;
}



Re: Ah Help With "Timed Public" - Matthew_Johnston - 27.08.2010

Oh Thanks Lads

Edit: No Waiiit...


SetTimerEx("paycheck",20000,1,"i",playerid);

Is that exactly how it should be Presented or is something ment to replace the "i" :P

EDIT: Nope, s And d, Nope.. No Sir.. No Wae,


Re: Ah Help With "Timed Public" - Jochemd - 27.08.2010

I don't know, I still didnt got how it works with 'i' but it is an integer. If it doesnt work, try "s" or "d"


Re: Ah Help With "Timed Public" - Hiddos - 27.08.2010

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
I don't know, I still didnt got how it works with 'i' but it is an integer. If it doesnt work, try "s" or "d"
's' is a string :P

That should work, but faster is:

pawn Код:
public paycheck()
{
SendClientMessageToAll(0xFFFF00AA, "---------------------------------------");
SendClientMessageToAll(0xFFFF00AA, "San Andreas Bank.");
SendClientMessageToAll(0xFFFF00AA, "Las Venturas Citezen Paycheck of 250$");
SendClientMessageToAll(0xFFFF00AA, "---------------------------------------");
for(new i; i < MAX_PLAYERS; i++)
{
  GivePlayerMoney(i, 250);
}
return 1;
}



Re: Ah Help With "Timed Public" - Matthew_Johnston - 27.08.2010

OMG, That Didnt Work Either!! :3 We Have a Problem?


Re: Ah Help With "Timed Public" - Jochemd - 27.08.2010

pawn Код:
GivePlayerMoney(i, 250);