25.10.2011, 17:26
Hey im making race system..And i want to add that you can build races at game...
How can i make that on every /addcheckpoint new checkpoint will be placed and all of them appear when i /startrace ...PLEASE HELP ME...ILL GIVE YOU A REP(OFC)
PHP код:
CMD:addcheckpoint(playerid,params[])
{
if (IsPlayerAdmin(playerid) == 1 && PlayerMakingRace[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREEN,"Checkpoint Added!");
SendClientMessage(playerid, COLOR_GREEN,"Use /stopmakerace when you finish adding checkpoints");
new Float:x,Float:y,Float:z,File:cpoint = fopen("Checkpoints.txt", io_write),cckpoint[200];
GetPlayerPos(playerid,x,y,z);
format(cckpoint,sizeof(cckpoint),"SetPlayerRaceCheckpoint(playerid,2,%d,%d,%d,0,0,0,3);\r\n",x,y,z);
fwrite(cpoint,cckpoint);
fclose(cpoint);
SetPlayerRaceCheckpoint(playerid,2,x,y,z,0,0,0,3);
CheckpointAdded[playerid] = 1;
}
return 1;
}