Playerid
#1

Hello! I need a little help with my gamemode. I have following under OnPlayerEnterCheckpoint:

Код:
public OnPlayerEnterCheckpoint(playerid)
{
	new string[256]; new playername [MAX_PLAYER_NAME];
	GetPlayerName (playerid, playername, sizeof(string));
  	if(gTeam[playerid] == TEAM_GREEN) {
		format (string, sizeof(string), "Server: %s (%d) is now planting bomb by the big transmitor!", playername, playerid);
		SendClientMessageToAll (ORANGE, string);
		SetTimer ("Disable", 10000, false);
	} else if(gTeam[playerid] == TEAM_BLUE) {
 		SendClientMessage (playerid, RED, "Error: Protect your transmitor!");
	}
	return;
}
And Following Timer to disable checkpoint:

Код:
forward Disable();
public Disable()
{
  DisablePlayerCheckpoint (playerid);
}
I get this error:

Quote:

I:\[0.2] Mini Missions Reborn\World war 3\gamemodes\TransmitorVillage.pwn(199) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

How can I define this "playerid" or help me to do this, fix it

Thanks!

Reply
#2

Change:
Quote:
Originally Posted by Ironboy500
Код:
SetTimer ("Disable", 10000, false);
to:
pawn Код:
SetTimerEx("Disable", 10000, false, "i", playerid);
and:
Quote:
Originally Posted by Ironboy500
Код:
forward Disable();
public Disable()
{
  DisablePlayerCheckpoint (playerid);
}
to:
Код:
forward Disable(playerid);

public Disable(playerid)
{
  DisablePlayerCheckpoint(playerid);
}
Reply
#3

Thank you very much!
Reply
#4

pawn Код:
forward Disable(playerid);
public Disable(playerid)
{
  DisablePlayerCheckpoint(playerid);
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)