public OnPlayerKeyStateChange(playerid){if(IsPlayerInRangeOfPoint( playerid, 1.0,-2218.9966,-2302.2263,31.2059)){SetPlayerPos(playerid, 1704.2389,1201.4531,35.2759);SetPlayerInterior(playerid,10);SetPlayerFacingAngle(playerid, 0);}}
Inventoryba kétlem, hogy SetPlayerPos-al dobna be. Add meg neki melyik gomb, és ne 1.0, hanem nagyobb (én 1.7-et szoktam) radiust adj meg.
Vagy timer vagy onPlayerUpdate (sok interiornal a timer takarekosabb, allitsd kb. 800-1000msre.
CMD:rszallit(playerid){if(PlayerInfo[playerid][pVpizza] <= 3){new rnd = random(sizeof(pizzak));SetPlayerCheckpoint(playerid,pizzak[rnd][0],pizzak[rnd][1],pizzak[rnd][2],2);///ide kellene hogy tovább dobjon még 2 darab cp re és és a cpknék kapjon pénzt }SendClientMessage(playerid, RED, \"Nincs nálad pizza amit kivihetnél!\");return 1;}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart){ OnPlayerHit(playerid, issuerid, weaponid, amount, bodypart); return 1;}
Run time error 4: \"Array index out of bounds\"[22:40:56] [debug] Accessing element at index 65535 past array upper bound 200[22:40:56] [debug] AMX backtrace:[22:40:56] [debug] #0 001b0e54 in ?? (65535, 1) from ****.amx[22:40:56] [debug] #1 00029488 in ?? (5, 65535, 54, 1106281319, 3) from ****.amx[22:40:56] [debug] #2 00027a48 in public OnPlayerTakeDamage (5, 65535, 1106281319, 54, 3) from ****.amx
Definiálni kéne a random cp-k pozícióját(?)
new Float:pizzak[10][3] = {{1269.4034,194.8707,19.1411}, // pizzacp1{1480.4790,378.3343,19.5996}, // pizzacp2{1406.8604,325.0777,18.5850}, // pizzacp3{2269.3328,95.6417,26.0630}, // pizzacp4{2257.4968,145.5856,26.0634}, // pizzacp5{2326.7285,-102.2134,26.0631}, // pizzacp7{2389.2195,-32.1964,26.0613}, // pizzacp8{2397.7119,20.7947,26.0632}, // pizzacp9{2448.2112,45.2753,26.0624} // pizzacp10