23.05.2016, 22:34
So guys I'm having a problem with my event system... So when the player that finished first enters the last race checkpoint I want to send a client message to whole server that he finished 1st. So I tried to get players name by command GetPlayerName(playerid, name, sizeof(name)); but it doesn't work idk why.
Error:
Here is code where the problem is:
Can anybody help me and why is this CODE option messing up my code when I paste it?
And idk why is my gamemode still called grandlarc but ok.. :/
Error:
Код:
D:\Samp server\gamemodes\grandlarc.pwn(3834) : error 033: array must be indexed (variable "name")
Код:
public OnPlayerEnterRaceCheckpoint(playerid) { //I cut out a part of code that comes here.. :) if(EventCheck[playerid] == 6) { EventCheck[playerid] = 0; new msg1[128], name[MAX_PLAYER_NAME]; name = GetPlayerName(playerid, name, sizeof(name)); if(zavrsili == 1) { if(zavrsili == 2) { if(zavrsili == 3) { SetPlayerHealth(playerid, 0); return 1; } format(msg1, sizeof(msg1), "Igrac %s je zavrsio event na trecem mestu! | Nagrada:$1000", name); SCMALL(COLOR_INFO, msg1); treci[playerid] = 1; zavrsili = 3; GivePlayerMoney(playerid, 1000); for(new id=0;id<MAX_PLAYERS;id++) { if(OnEvent[id] == 1) { SetPlayerHealth(id, 0); OnEvent[id] = 0; poceo = 0; eventid = 0; } } return 1; } format(msg1, sizeof(msg1), "Igrac %s je zavrsio event na drugom mestu! | Nagrada:$2000", name); SCMALL(COLOR_INFO, msg1); drugi[playerid] = 1; zavrsili = 2; GivePlayerMoney(playerid, 2000); return 1; } format(msg1, sizeof(msg1), "Igrac %s je zavrsio event na prvom mestu! | Nagrada:$3000", name); SCMALL(COLOR_INFO, msg1); prvi[playerid] = 1; zavrsili = 1; GivePlayerMoney(playerid, 3000); return 1; } return 1; }
And idk why is my gamemode still called grandlarc but ok.. :/