[SOLVED]Players ain't moving when my ranks script is on server
#1

Hey guys! Still got a other problem xd now it's with my ranks system. On Pawno, There's no errors or warnings, but when i go in-game with other people, i don't see the players moving! that's since i added some lines in public OnPlayerupdate. I Sent my script with this post. (please, don't use it in your server xD)
(it's a big modded vr of Toniu's, i was planning to add commands with player ranks status but i saw this bug)

Thanks for help
Reply
#2

Do anyone know what's wrong? i can't find out by my self :\
Reply
#3

the lne 619:
Code:
return 1;
needs to be line 617 ^^
the function then WILL return 1; it somehow found its way out of the function...
Reply
#4

ok thanks! ill go see if it works
Reply
#5

yea i can see the people around moving but my onplayerupdate just don't work xD example i have a score of 7 but it doesn't upgrade my rank... it stays on 'normal guy' . Why?
heres my onplayerupdate
Code:
public OnPlayerUpdate(playerid)
{
	if(GetPlayerScore(playerid) == 5)
 	{
	SetPlayerRank(playerid, 1);
	}
	else if(GetPlayerScore(playerid) == 20)
	{
	SetPlayerRank(playerid, 2);
	}
	else if(GetPlayerScore(playerid) == 35)
 	{
	SetPlayerRank(playerid, 3);
	}
	else if(GetPlayerScore(playerid) == 50)
	{
	SetPlayerRank(playerid, 4);
	}
	else if(GetPlayerScore(playerid) == 75)
	{
	SetPlayerRank(playerid, 5);
	}
	else if(GetPlayerScore(playerid) == 100)
	{
	SetPlayerRank(playerid, 6);
	}
	else if(GetPlayerScore(playerid) == 150)
	{
	SetPlayerRank(playerid, 7);
	}
	else if(GetPlayerScore(playerid) == 175)
	{
	SetPlayerRank(playerid, 8);
	}
	else if(GetPlayerScore(playerid) == 200)
	{
	SetPlayerRank(playerid, 9);
	}
	else if(GetPlayerScore(playerid) == 250)
	{
	SetPlayerRank(playerid, 10);
	}
	else if(GetPlayerScore(playerid) == 300)
	{
	SetPlayerRank(playerid, 11);
	}
	else if(GetPlayerScore(playerid) == 1000)
	{
	SetPlayerRank(playerid, 12);
	}
	return 1;
}
Reply
#6

Ok it's fine but i got 1 error, look:

Code:
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(679) : error 030: compound statement not closed at the end of file (started at line 624)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Script from 679 to the end:
Code:
public GameUpdate(playerid)
{
  PlayerLoop(i)
	{
	if(GetPlayerScore(playerid) == 5)
 	{
	SetPlayerRank(playerid, 1);
	}
	else if(GetPlayerScore(playerid) == 20)
	{
	SetPlayerRank(playerid, 2);
	}
	else if(GetPlayerScore(playerid) == 35)
 	{
	SetPlayerRank(playerid, 3);
	}
	else if(GetPlayerScore(playerid) == 50)
	{
	SetPlayerRank(playerid, 4);
	}
	else if(GetPlayerScore(playerid) == 75)
	{
	SetPlayerRank(playerid, 5);
	}
	else if(GetPlayerScore(playerid) == 100)
	{
	SetPlayerRank(playerid, 6);
	}
	else if(GetPlayerScore(playerid) == 150)
	{
	SetPlayerRank(playerid, 7);
	}
	else if(GetPlayerScore(playerid) == 175)
	{
	SetPlayerRank(playerid, 8);
	}
	else if(GetPlayerScore(playerid) == 200)
	{
	SetPlayerRank(playerid, 9);
	}
	else if(GetPlayerScore(playerid) == 250)
	{
	SetPlayerRank(playerid, 10);
	}
	else if(GetPlayerScore(playerid) == 300)
	{
	SetPlayerRank(playerid, 11);
	}
	else if(GetPlayerScore(playerid) == 1000)
	{
	SetPlayerRank(playerid, 12);
	}
	return 1;
}
thanks for helping
Reply
#7

alright! thanks for the tip xd but i only got a warning which is no sense because im not using Strtok:

C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(680) : warning 203: symbol is never used: "strtok"

xd i don't have line 680!


whatever, thnks again :P
Reply
#8

You get that warning because in some include there's the strtok function that isn't used in your code.
Reply
#9

ok

but ahhhhh i just tested and it doesnt work :\ . I've got 15 kills but it's still Normal Guy. What's wrong?
xd sorry for all trouble






here's new script attached.
Reply
#10

yes i did, everything's alright with that but must it be on the filterscript? or it doesnt matter if its on my gamemode :\

i currently have it on my GM
Reply
#11

i've added it in both scripts but still nothing :\ if you 'd like to test right now, add in ur favs by using my IP

EDIT:
Quote:

The score inclination and gameupdate doesn't matter what script it's in but try putting them in same script


Edit: try removing the 'else's from the if statements and add a new variable for the players score so its just:

PlayerLoop(i)
{
new pScore = GetPlayerScore(i);
if(pScore == 5)
{
SetPlayerRank(i, 1);
}
if(pScore == 20)
{

etc

ok ill try that and come back :P
Reply
#12

Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
OnPlayerUpdate is called for each player every 100 ms [correct me if i'm wrong :P]
You're wrong, OnPlayerUpdate is called for every frame of the client's computer, example: 30FPS (frames per second) will call OnPlayerUpdate every 33ms on average. So if the player's computer lags a lot (like when loading mods or something) OnPlayerUpdate will be called less frequently.
Reply
#13

Southclaw > it didn't work, still same problem.

i've attached a pic of it
Reply
#14

The code for this is /rep, it will show the player's stat, but it isnt the only problem, the Normal guy at right is supposed to be killer...

and my setplayerrank function i don't understand what you mean XD are you talking about this?:

Код:
#define RANK_NORMAL_GUY 0
#define RANK_KILLER 1
#define RANK_SERIAL_KILLER 2
#define RANK_MUST_BE_JAILED 3
#define RANK_TRANSFORMED 4
#define RANK_PUBLIC_DANGER 5
#define RANK_MONSTER 6
#define RANK_MANIAC 7
#define RANK_HUNTER 8
#define RANK_ARMY_OF_ONE 9
#define RANK_PSYCHODELIC_KILLER 10
#define RANK_THE_REAL_MAD 11
#define GET_UR_SELF_A_LIFE 12
Reply
#15

xD im not using sandra's lol it's toniu's but i moded it because his wasn't working well... :\

Quote:
Originally Posted by [ĦŁ₣
ŠǾǖŦĦЗŁΛẄ ]
Ok, I see you are using Sandra's ranks system, but in your OnPlayerDeath you have a thing that sets the killers array pRank but on GameUpdate it uses SetPlayerRank
yea i figured out that i was using pRank, but when i try to replace it gives errors as:

undefined symbol "SetpRank"

do i have to do:
Код:
new SetpRank[MAX_PLAYERS];
?
Reply
#16

No i know what to do ill replace all pRank with PlayerRank And change my define, ill tell if it works

EDIT:
nah it isn't working.
Reply
#17

i don't think i got it all.... i did this:
Код:
public GameUpdate(playerid)
{

  PlayerLoop(i)
  {
   if(GetPlayerScore(i) == 5)
   {
   pRank[playerid](i, 1);
   }
   if(GetPlayerScore(i) == 20)
   {
     pRank[playerid](i, 2);
   }
   if(GetPlayerScore(i) == 35)
   {
   pRank[playerid](i, 3);
   }
   if(GetPlayerScore(i) == 50)
   {
   pRank[playerid](i, 4);
   }
   if(GetPlayerScore(i) == 75)
   {
   pRank[playerid](i, 5);
   }
   if(GetPlayerScore(i) == 100)
   {
   pRank[playerid](i, 6);
   }
   if(GetPlayerScore(i) == 150)
   {
   pRank[playerid](i, 7);
   }
   if(GetPlayerScore(i) == 175)
   {
   pRank[playerid](i, 8);
   }
   if(GetPlayerScore(i) == 200)
   {
   pRank[playerid](i, 9);
   }
   if(GetPlayerScore(i) == 250)
   {
   pRank[playerid](i, 10);
   }
   if(GetPlayerScore(i) == 300)
   {
   pRank[playerid](i, 11);
   }
   if(GetPlayerScore(i) == 1000)
   {
   pRank[playerid](i, 12);
   }
  }
}

//---------------------
and i get 12 errors with warnings :\
Код:
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(639) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(639) : error 001: expected token: ";", but found "("
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(639) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(643) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(643) : error 001: expected token: ";", but found "("
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(643) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(647) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(647) : error 001: expected token: ";", but found "("
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(647) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(651) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(651) : error 001: expected token: ";", but found "("
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(651) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(655) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(655) : error 001: expected token: ";", but found "("
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(655) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(659) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(659) : error 001: expected token: ";", but found "("
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(659) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(663) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(663) : error 001: expected token: ";", but found "("
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(663) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(667) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(667) : error 001: expected token: ";", but found "("
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(667) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(671) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(671) : error 001: expected token: ";", but found "("
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(671) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(675) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(675) : error 001: expected token: ";", but found "("
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(675) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(679) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(679) : error 001: expected token: ";", but found "("
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(679) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(683) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(683) : error 001: expected token: ";", but found "("
C:\Program Files (x86)\Rockstar games\Gta San Andreas\dedicated server\filterscripts\MHranks.pwn(683) : warning 215: expression has no effect
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


12 Errors.
what am i missing?
Reply
#18

i think i found out :

Код:
public GameUpdate(playerid)
{

  PlayerLoop(i)
  {
   if(GetPlayerScore(i) == 5)
   {
   pRank[playerid] = (i, 1);
   }
   if(GetPlayerScore(i) == 20)
   {
   pRank[playerid] = (i, 2);
   }
   if(GetPlayerScore(i) == 35)
   {
   pRank[playerid] = (i, 3);
   }
   if(GetPlayerScore(i) == 50)
   {
   pRank[playerid] = (i, 4);
   }
   if(GetPlayerScore(i) == 75)
   {
   pRank[playerid] = (i, 5);
   }
   if(GetPlayerScore(i) == 100)
   {
   pRank[playerid] = (i, 6);
   }
   if(GetPlayerScore(i) == 150)
   {
   pRank[playerid] = (i, 7);
   }
   if(GetPlayerScore(i) == 175)
   {
   pRank[playerid] = (i, 8);
   }
   if(GetPlayerScore(i) == 200)
   {
   pRank[playerid] = (i, 9);
   }
   if(GetPlayerScore(i) == 250)
   {
   pRank[playerid] = (i, 10);
   }
   if(GetPlayerScore(i) == 300)
   {
   pRank[playerid] = (i, 11);
   }
   if(GetPlayerScore(i) == 1000)
   {
   pRank[playerid] = (i, 12);
   }
  }
}
i'll go see if it's alright
Reply
#19

Yes it works! but i can't promote with a admincommand, like setscore (ID) 5, it don't work. but if i really have the points when i connect, it's alright. I'll try to fix that later and thanks for all Southclaw!!!


EDIT:

i could simply make a command like /setrank (id) (lvl)

and it would set score to X points depending on the requirement.

BTW/ can i do something for setskin so i wouldn't have ~700 lines for all skins from 0-299? thanks
Reply
#20

ok ill take it out
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)