OnPlayerSpawn
#1

i want to make gang colors,as if someone is in a family slot 1 for example,when he logs in his color will be the same as slot's 1 color,i have made like this:
if(PlayerInfo[playerid][pFMember] = 1
{
SetPlayerColor(playerid, COLOR_ORANGE);
}


And it shows me an error:
C:\Users\John\Desktop\NGRP+NERP 0.3x\gamemodes\NERP.pwn(11486) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
how to fix?
Reply
#2

it's '==' not '=', two =s and also remove ; from end

if(PlayerInfo[playerid][pFMember] == 1)
{
SetPlayerColor(playerid, COLOR_YELLOW);
}
Reply
#3

it keeps saying:
C:\Users\John\Desktop\NGRP+NERP 0.3x\gamemodes\NERP.pwn(11486) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

LocMax answered you,your 11486 line looks like this:
Код:
if(PlayerInfo[playerid][pFMember] = 1);
But it needs to be like this:
Код:
if(PlayerInfo[playerid][pFMember] == 1)
Reply
#5

place this anywhere in your script


Код:
SetPlayerToTeamColor(playerid)
{
	if(PlayerInfo[playerid][pFMember] == 1) { SetPlayerColor(playerid,COLOR_RED); }
	else if(PlayerInfo[playerid][pFMember] == 2) { SetPlayerColor(playerid,COLOR_BLUE; }
	return 1;
}
and add
Код:
public OnPlayerSpawn(playerid)
{
      SetPlayerToTeamColor(playerid);
      return 1;
}
Reply
#6

pawn Код:
if(PlayerInfo[playerid][pFMember] == 1)
{
SetPlayerColor(playerid, COLOR_ORANGE);
}
else SetPlayerColor(playerid, COLOR_GREEN); //this is color for players that non member
Reply
#7

Adann,it showed me 2 errors when i used urs:
C:\Users\John\Desktop\NGRP+NERP 0.3x\gamemodes\NERP.pwn(11486) : error 010: invalid function or declaration
C:\Users\John\Desktop\NGRP+NERP 0.3x\gamemodes\NERP.pwn(11490) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.


and tegathron it keeps showing the same error
Reply
#8

Quote:
Originally Posted by iBots
Посмотреть сообщение
Adann,it showed me 2 errors when i used urs:
C:\Users\John\Desktop\NGRP+NERP 0.3x\gamemodes\NERP.pwn(11486) : error 010: invalid function or declaration
C:\Users\John\Desktop\NGRP+NERP 0.3x\gamemodes\NERP.pwn(11490) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.


and tegathron it keeps showing the same error
Show picture of changed code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)