08.06.2009, 06:23
Hello, I am making my first format line, an I have a problem... here is my code:
And my 2 errors:
[code=errors]
C:\Documents and Settings\Alive\Desktop\alive's server\gamemodes\alive.pwn(92) : error 033: array must be indexed (variable "kName")
C:\Documents and Settings\Alive\Desktop\alive's server\gamemodes\alive.pwn(93) : error 033: array must be indexed (variable "pName")
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
[/code]
Line 92 = kName = GetPlayerName(killerid, kName, sizeof(kName));
Line 93 = pName = GetPlayerName(playerid, pName, sizeof(pName));
I am really stuck at this.. So can someone help me, please?
Would be very nice...
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new string[256];
new kName[MAX_PLAYER_NAME];
new pName[MAX_PLAYER_NAME];
kName = GetPlayerName(killerid, kName, sizeof(kName));
pName = GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "Dear, %s, if player %s will kill you again please report him to administrators.", pName, kName);
GameTextForPlayer(playerid, string, 5000, 5);
SendDeathMessage(killerid, playerid, reason);
GivePlayerMoney(killerid, -10000);
GameTextForPlayer(killerid, "~r~Fighting ~w~is ~r~NOT ~g~allowed~n~~w~in this ~g~server~n~~w~go to ~y~//dm!", 5000, 5);
return 1;
}
And my 2 errors:
[code=errors]
C:\Documents and Settings\Alive\Desktop\alive's server\gamemodes\alive.pwn(92) : error 033: array must be indexed (variable "kName")
C:\Documents and Settings\Alive\Desktop\alive's server\gamemodes\alive.pwn(93) : error 033: array must be indexed (variable "pName")
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
[/code]
Line 92 = kName = GetPlayerName(killerid, kName, sizeof(kName));
Line 93 = pName = GetPlayerName(playerid, pName, sizeof(pName));
I am really stuck at this.. So can someone help me, please?
Would be very nice...