Ah Help With "Timed Public"
#1

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;
}
Reply
#2

Code please.
Reply
#3

Code Added*
Reply
#4

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

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

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

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,
Reply
#7

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"
Reply
#8

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;
}
Reply
#9

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)