SA-MP Forums Archive
Help with this small code - 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: Help with this small code (/showthread.php?tid=385397)



Help with this small code - Face9000 - 15.10.2012

Hello, this is a small code to promote a player to respected player after he reach 6k score, but seems don't work:

pawn Код:
if(GetPlayerScore(i) == 6000)
{
new m[128];
SendClientMessage(i,COLOR_PINK,"You have been promoted to respected player! Congrats!");
format(m, sizeof(m), "%s (%d) has been promoted to Respected Player!", nick,i);
SendClientMessageToAll(yellow, m);
PlayerInfo[i][pRespected] = 1;
new mrand =random(15000);
GivePlayerMoney(i,-mrand);
GameTextForPlayer(i, "~w~Promoted ~g~to ~r~Respected ~y~Player ~b~!", 5000, 5);
SetPlayerScore(i, GetPlayerScore(i) + 5);
}
It's inside a timer.


Re: Help with this small code - gtakillerIV - 15.10.2012

Can we please see like the whole Timer, if so then thanks.


Re: Help with this small code - Face9000 - 15.10.2012

It's the anticheat timer, for not using two separate timers (one for Anticheat and another for this),i regrouped in one.


Re: Help with this small code - gtakillerIV - 15.10.2012

Okay then can I see your loop?

And can you please explain what happens when you reach 6k score?

Does it do something or it doesn't do anything?


Re: Help with this small code - RedJohn - 15.10.2012

gtakillerIV: When I reach 6K score then I am Respected player. Try to replace i with playerid. Just to test if its working.


Re: Help with this small code - lorizz - 15.10.2012

no it simply need to put return 1; at the end ^^


Re: Help with this small code - gtakillerIV - 15.10.2012

Quote:
Originally Posted by RedJohn
Посмотреть сообщение
gtakillerIV: When I reach 6K score then I am Respected player. Try to replace i with playerid. Just to test if its working.
It's inside a loop and playerid is not defined since he doesn't execute/do anything(Correct me if I'm wrong).

And I didn't really understand what happens.


Re: Help with this small code - RedJohn - 15.10.2012

Sorry for double post.

Image this. If you have 18 years you are adult right?

So here if you have 6000 score you are Respected user on server, like ****** (just for example) on this forum. Get it now?


Re: Help with this small code - Face9000 - 15.10.2012

Quote:
Originally Posted by lorizz
Посмотреть сообщение
no it simply need to put return 1; at the end ^^
Does if i put return 1; it will stop other things inside that timer? I think yes.

Quote:
Originally Posted by gtakillerIV
Посмотреть сообщение
Okay then can I see your loop?

And can you please explain what happens when you reach 6k score?

Does it do something or it doesn't do anything?
When you reach 6k you are a Respected Player.


Re: Help with this small code - Ghost_Boii - 15.10.2012

What Do You Mean?