27.10.2010, 17:30
Ok so I tryed to made winer place for my race, but there's something bad and I don't know what is wrong.It should be like that: when first player enters into the last checkpoint, it disables and player gets message in the chatbox that he won the game, because he first and he gets 10000$, oh and the last point, that everyone who was participating in the race gets the message that concrete player won the race and for them also disappear all checkpoints, which are left.So I will show you the last code lines, because everything what I wrote recently is these lines:
So how you see what I wrote in the code I think is correct, because there is no errors while compiling.But when I'm in the game and participating in the race, in the last cp(checkpoint) I get nothing-no money,no message...So what is the problem in these lines, maybe i need to write it differently?Thank you for the help!
Код:
else if(cp[playerid] == 15) { cp[playerid] = SetPlayerRaceCheckpoint(playerid, 1, -2329.8938,-1607.2220,483.5648, 0.0,0.0,0.0, 9); cp[playerid] = 16; } else if(cp[playerid] == 16) { DisablePlayerRaceCheckpoint(playerid); new Float:x,Float:y,Float:z; position = GetVehiclePos(playerid, x, y, z); position == 16 SendClientMessage(playerid, 0xFFFFFAA, "Tu esi nugaletojas-sveikiname!!!"); new zaidejas1[100]; new pname[MAX_PLAYERS]; GetPlayerName(playerid, pname, sizeof(pname)); format(zaidejas1, sizeof(zaidejas1), "Lenktynes baigtos! %s jas laimejo ir gavo 10000litu!", pname); SendClientMessageToAll(0xFFFFFAA, zaidejas1); GivePlayerMoney(playerid, 10000); } return 1; }