SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 15/11/2011, 07:04 PM   #11
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,735
Reputation: 1686
Default Re: very very short random player win money

First of all: Why is "JunkBuster" included? I see you're not using any functions of it.
Secondly: This won't work. You have the SetTimer, and that timer calls the callback "winer" and I don't see the "forward winner();" and "public winner(){code}". You should change the SetTimer("winer", 120000, 1); (line 15) with this: SetTimer("reminder", 120000, 1);. Then it should work. I'd also remove line 1 (#include <JunkBuster>) because that one doesn't really make sense. If you are using JunkBuster and if you need to do this at the top of every filterscript, use #tryinclude.
And did you really try this? - You lied when you said this is working because it can not work. There is no 'winer' callback.
Quote:
i just test it in ! i insert it in riverShal G.m and it works
That's the post I was talking about.
__________________
When the opportunity presents itself to flip-a da table, uh, you flip-a da table.

Discord: Kwarde#8009
Kwarde is online now   Reply With Quote
Old 15/11/2011, 07:17 PM   #12
ft941
Big Clucker
 
Join Date: Feb 2009
Posts: 103
Reputation: 0
Default Re: Re : Respuesta: very very short random player win money

Quote:
Originally Posted by Amine_Mejrhirrou View Post
true it's simpler like that
GetRandomPlayer(iPlayer = INVALID_PLAYER_ID)
{
offline:
iPlayer = random(MAX_PLAYERS);

if(!IsPlayerConnected(iPlayer)) goto offline;
return iPlayer;
}

this is like ms dos omg! I didn't know that in pawn it's possible make that!
ft941 is offline   Reply With Quote
Old 15/11/2011, 07:23 PM   #13
Astralis
Guest
 
Posts: n/a
Default Re: very very short random player win money

simple. keep it up.
  Reply With Quote
Old 15/11/2011, 09:17 PM   #14
HB
Huge Clucker
 
Join Date: Sep 2007
Posts: 486
Reputation: 45
Default Re: very very short random player win money

Wow. This is so bad: It will crash the server when there are no players online. Hosters definately will not be happy with this code.
HB is offline   Reply With Quote
Old 15/11/2011, 10:47 PM   #15
marinov
Gangsta
 
marinov's Avatar
 
Join Date: Oct 2010
Location: San Andreas
Posts: 591
Reputation: 8
Default Re: very very short random player win money

This code makes me sick
__________________
http://mczombiecom.co.nr/
marinov is offline   Reply With Quote
Old 15/11/2011, 11:06 PM   #16
Gamer_Z
Guest
 
Posts: n/a
Default Re: very very short random player win money

this hsouldn't freeze the server:
pawn Code:
GetRandomPlayer(iPlayer = INVALID_PLAYER_ID)
{
new bool:xxx = false;

for(new x = 0, z = GetMaxPlayers(); x < z; ++x)if(IsPlayerConnected(x)){xxx = true;break;}
if(!xxx)return -1;
offline:
iPlayer = random(MAX_PLAYERS);

if(!IsPlayerConnected(iPlayer)) goto offline;
return iPlayer;
}

your best bet would be to make an variable which counts players, do ++ in onplayerconnect and -- in onplayerdisconnect, then just check if the variable is 0.
  Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
New player gets random money :S leapfish Help Archive 8 07/03/2010 01:39 PM
One short question about Player Class Dujma Help Archive 4 21/10/2009 01:14 AM
Money Drop all the player money? steven_italy Help Archive 1 15/06/2009 12:16 PM


All times are GMT. The time now is 05:49 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.