03.12.2012, 00:47
Hi i has problem how to make playertopoint this !
See code
From code
when use /dropcar it random droppoint everywhere i set droppoint
and when live in checkpoint it callback Checkstatsdrop for check
line
if(PlayerToPoint(10.0, playerid, Droppoints[randomdrop][0], Droppoints[randomdrop][1], Droppoints[randomdrop][2]))
it not work i don't know why
Help me please i want that line check point from random point
sorry my english not good
and srroy if topic wrong section
Thankyou
See code
Код:
new Float:Droppoints[12][3] = { {2633.7322,-2225.9976,16.0032}, {2377.5972,-2015.3059,14.5391}, {2319.6648,-60.4596,26.1903}, {2316.2500,-1262.0723,23.6445}, {2520.2161,-1481.6255,23.7050}, {2769.5874,-1606.9584,10.6290}, {2746.5488,-1943.9832,13.2526}, {2486.1035,-1953.5966,13.1305}, {2644.9189,-2115.9495,13.2527}, {2071.1174,-2082.0615,13.2528}, {1784.1438,-1701.0361,13.2067}, {1384.5203,-1466.1799,13.2544} }; if(strcmp(cmd, "/dropcar", true) == 0) { if(Dropcarpoint[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE,"Checkpoint ·Хи№Сґ¤Ші№УГ¶д»Ки§ВС§¤§НВЩи (/undropcar аѕЧиНВЎаЕФЎ)"); return 1; } if(Dropcarpoint[playerid] == 2) { SendClientMessage(playerid, COLOR_WHITE,"¤ШіѕЦи§ВЎаЕФЎ Checkpoint ·Хи№Сґ¤Ші№УГ¶д»Ки§ в»ГґЕН§гЛБиг№АТВЛЕС§"); return 1; } GameTextForPlayer(playerid, "~w~Car Selling ~n~~r~Drop the car at the Checkpoint", 5000, 1); Dropcarpoint[playerid] = 1; new randomdrop; randomdrop = random(sizeof(Droppoints)); SetPlayerCheckpoint(playerid, Droppoints[randomdrop][0], Droppoints[randomdrop][1], Droppoints[randomdrop][2], 5.0); } public OnPlayerEnterCheckpoint(playerid) { if(Dropcarpoint[playerid] == 1) { SendClientMessage(playerid, COLOR_SUPERRED, "*ЎГШіТЁНґВТ№ѕТЛ№РгЛйНВЩи㹨شᴧбЕРЎГШіТНВЩиг№Г¶бЕйЗГНКСЎ¤ГЩи......."); SendClientMessage(playerid, COLOR_SUPERRED, "*ГРєєЎУЕС§µГЗЁКНєЎТГЎГР·УўН§¤Ші......."); PlayerIsDropcar[playerid] = 1; SetTimerEx("Checkstatsdrop", 5000, 0, "i", playerid); } else { return 1; } return 1; } public Checkstatsdrop(playerid) { new string[128]; if(IsPlayerConnected(playerid)) { if(PlayerIsDropcar[playerid]==1) { new randomdrop; if(PlayerToPoint(10.0, playerid, Droppoints[randomdrop][0], Droppoints[randomdrop][1], Droppoints[randomdrop][2])) { if(IsPlayerInAnyVehicle(playerid)) { PlayerInfo[playerid][pJackSkill] ++; if(PlayerInfo[playerid][pJackSkill] == 750) { SendClientMessage(playerid, COLOR_YELLOW, "* Your Car Jack Skill is now Level 2, you will earn more Money."); } else if(PlayerInfo[playerid][pJackSkill] == 1250) { SendClientMessage(playerid, COLOR_YELLOW, "* Your Car Jack Skill is now Level 3, you will earn more Money."); } else if(PlayerInfo[playerid][pJackSkill] == 1850) { SendClientMessage(playerid, COLOR_YELLOW, "* Your Car Jack Skill is now Level 4, you will earn more Money."); } else if(PlayerInfo[playerid][pJackSkill] == 2200) { SendClientMessage(playerid, COLOR_YELLOW, "* Your Car Jack Skill is now Level 5, you will earn more Money."); } new level = PlayerInfo[playerid][pJackSkill]; if(level >= 0 && level <= 750) { new rand = random(sizeof(SELLCAR1)); format(string, sizeof(string), " ¤ШідґйГСє $%d ЁТЎЎТГКи§Г¶аГХВєГйНВбЕйЗ", SELLCAR1[rand]); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); SafeGivePlayerMoney(playerid, SELLCAR1[rand]); } else if(level >= 751 && level <= 1250) { new rand = random(sizeof(SELLCAR2)); format(string, sizeof(string), " ¤ШідґйГСє $%d ЁТЎЎТГКи§Г¶аГХВєГйНВбЕйЗ", SELLCAR2[rand]); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); SafeGivePlayerMoney(playerid, SELLCAR2[rand]); } else if(level >= 1251 && level <= 1850) { new rand = random(sizeof(SELLCAR3)); format(string, sizeof(string), " ¤ШідґйГСє $%d ЁТЎЎТГКи§Г¶аГХВєГйНВбЕйЗ", SELLCAR3[rand]); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); SafeGivePlayerMoney(playerid, SELLCAR3[rand]); } else if(level >= 1851 && level <= 2200) { new rand = random(sizeof(SELLCAR4)); format(string, sizeof(string), " ¤ШідґйГСє $%d ЁТЎЎТГКи§Г¶аГХВєГйНВбЕйЗ", SELLCAR4[rand]); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); SafeGivePlayerMoney(playerid, SELLCAR4[rand]); } else if(level >= 2201) { new rand = random(sizeof(SELLCAR5)); format(string, sizeof(string), " ¤ШідґйГСє $%d ЁТЎЎТГКи§Г¶аГХВєГйНВбЕйЗ", SELLCAR5[rand]); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); SafeGivePlayerMoney(playerid, SELLCAR5[rand]); } GameTextForPlayer(playerid, "~y~Sold the car", 2500, 1); Dropcarpoint[playerid] = 0; DisablePlayerCheckpoint(playerid); SetVehicleToRespawn(GetPlayerVehicleID(playerid)); PlayerIsDropcar[playerid] = 0; } else { GameTextForPlayer(playerid, "~w~You Are not in ~r~Vehicle", 5000, 1); SendClientMessage(playerid, COLOR_GRAD1, "¤ШідБидґйНВЩиг№Г¶·ХиЁРКи§ ·Т§аГТўНВЎаЕФЎЎТГКи§Г¶г№¤ГС駹Хй"); Dropcarpoint[playerid] = 3; DisablePlayerCheckpoint(playerid); PlayerIsDropcar[playerid] = 0; SetTimerEx("Checkundrop", 10000, 0, "i", playerid); } } else { GameTextForPlayer(playerid, "~w~You Are not in ~r~Checkpoint", 5000, 1); SendClientMessage(playerid, COLOR_GRAD1, " ¤ШідБидґйНВЩи·ХиЁШґ Checkpoint №СґКи§Г¶"); return 1; } } }
when use /dropcar it random droppoint everywhere i set droppoint
and when live in checkpoint it callback Checkstatsdrop for check
line
if(PlayerToPoint(10.0, playerid, Droppoints[randomdrop][0], Droppoints[randomdrop][1], Droppoints[randomdrop][2]))
it not work i don't know why
Help me please i want that line check point from random point
sorry my english not good
and srroy if topic wrong section
Thankyou