01.06.2011, 21:55
pawn Код:
error 017: undefined symbol "playerid"
pawn Код:
TextDrawShowForPlayer(playerid, BlackTD); // Error line
error 017: undefined symbol "playerid"
TextDrawShowForPlayer(playerid, BlackTD); // Error line
public scavengetimer()
{
TextDrawShowForPlayer(playerid, BlackTD);
return 1;
}
public scavengetimer()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
TextDrawShowForPlayer(i, BlackTD);
return 1;
}
}
Exactly, you're missing the playerid parameter.
Can you show me where you're calling this function? do you execute it with a timer? |
command(scavenge, playerid, params[])
{
if(PlayerInfo[playerid][Srt] >= 1)
{
SendClientMessage(playerid, COLOUR_ORANGE, "Hint: You need to wait 10 minutes!" );
}
else
{
if(IsPlayerInRangeOfPoint(playerid, 100,637.3656, 838.5986, -42.9609))
{
{
new string[ 128 ];
format( string, sizeof( string ), "* %s has started to scavenge.", GetName( playerid ) );
NearByMessage( playerid, COLOUR_YELLOW, string );
SetTimer("scavengetimer",5000, false); //Here
PlayerInfo[playerid][Srt] = 1;
new rand = random(20);
switch(rand)
{
case 0, 3, 5, 7:
{
SendClientMessage(playerid, COLOUR_WHITE, "You found a Stimpack!");
PlayerInfo[playerid][Stimpack]++;
}
case 1, 4, 6, 8:
{
SendClientMessage(playerid, COLOUR_WHITE, "You found 300 caps!");
}
case 2, 10, 13, 16, 18, 15, 19:
{
SendClientMessage(playerid, COLOUR_WHITE, "Your hands are dirty but you find nothing!");
}
case 9, 11, 12, 14, 17:
{
SendClientMessage(playerid, COLOUR_WHITE, "You have found 100 scrap metal!");
PlayerInfo[playerid][Metal] += 100;
}
}
}
}
}
return 1;
}
SetTimer("scavengetimer",5000, false); //Here
SetTimerEx("scavengetimer", 5000, false, "i", playerid);
public scavengetimer()
{
TextDrawShowForPlayer(playerid, BlackTD);
return true;
}
public scavengetimer(playerid)
{
TextDrawShowForPlayer(playerid, BlackTD);
return true;
}
new Text:BlackTD;
public OnGameModeInit()
{
BlackTD = TextDrawCreate(0.0, 0.0, "_");
TextDrawUseBox(BlackTD, true);
TextDrawColor(BlackTD, 0);
TextDrawBoxColor(BlackTD, 0x00000000);