if (strcmp("/DD3", cmdtext, true, 10) == 0) { SendClientMessage(playerid, COLOR_BLUE, "You just got Teleported to Derby Map!"); return 1; }
{2580.9543,-2922.2375,1003.8871},{2580.9353,-3040.3372,1003.8871},{2620.9497,-2980.4980,1003.8871}, {2662.5625,-2922.4089,1003.8871},{2682.1228,-2959.8835,1003.8871},{2663.1399,-2999.8201,1003.8871}, {2581.3845,-2962.0913,1003.8871},{2606.0146,-2995.0747,1003.8871},{2601.6973,-2941.1292,1003.8871}, {2581.7783,-2959.8501,1003.8871} {3811.2156,-2453.5735,1002.5284},{3828.2717,-2437.7588,1002.5284},{3797.6394,-2471.6860,1002.5284}, {3778.0747,-2452.8750,1002.5284},{3848.7319,-2453.9375,1002.5284},{3828.6216,-2453.9402,1015.5284}, {3797.5637,-2453.8789,1015.5284},{3855.7751,-2472.6580,1015.5284},{3770.3140,-2436.6235,1015.5284}, {3811.2190,-2436.3999,1015.5284}
if (strcmp("/DD3", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid,2580.9543,-2922.2375,1003.8871);
SendClientMessage(playerid, COLOR_BLUE, "You just got Teleported to Derby Map!");
return 1;
}
new Float:RandomSpawn[][] =
{
{2580.9543,-2922.2375,1003.8871},
{2580.9353,-3040.3372,1003.8871},
{2620.9497,-2980.4980,1003.8871},
{2662.5625,-2922.4089,1003.8871},
{2682.1228,-2959.8835,1003.8871},
{2663.1399,-2999.8201,1003.8871},
{2581.3845,-2962.0913,1003.8871},
{2606.0146,-2995.0747,1003.8871},
{2601.6973,-2941.1292,1003.8871},
{2581.7783,-2959.8501,1003.8871},
{3811.2156,-2453.5735,1002.5284},
{3828.2717,-2437.7588,1002.5284},
{3797.6394,-2471.6860,1002.5284},
{3778.0747,-2452.8750,1002.5284},
{3848.7319,-2453.9375,1002.5284},
{3828.6216,-2453.9402,1015.5284},
{3797.5637,-2453.8789,1015.5284},
{3855.7751,-2472.6580,1015.5284},
{3770.3140,-2436.6235,1015.5284},
{3811.2190,-2436.3999,1015.5284}
};
if (strcmp("/DD3", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_BLUE, "You just got Teleported to Derby Map!");
new Random = random(sizeof(RandomSpawn));
SetPlayerPos(playerid, RandomSpawn[Random][0], RandomSpawn[Random][1], RandomSpawn[Random][2]);
return 1;
}
Not tested but that should work.
pawn Код:
|
error 032: array index out of bounds (variable "RandomSpawn")
Bro!!... This error
Код HTML:
error 032: array index out of bounds (variable "RandomSpawn") |
new Float:RandomSpawn[][] =
{
{2580.9543,-2922.2375,1003.8871},
{2580.9353,-3040.3372,1003.8871},
{2620.9497,-2980.4980,1003.8871},
{2662.5625,-2922.4089,1003.8871},
{2682.1228,-2959.8835,1003.8871},
{2663.1399,-2999.8201,1003.8871},
{2581.3845,-2962.0913,1003.8871},
{2606.0146,-2995.0747,1003.8871},
{2601.6973,-2941.1292,1003.8871},
{2581.7783,-2959.8501,1003.8871},
{3811.2156,-2453.5735,1002.5284},
{3828.2717,-2437.7588,1002.5284},
{3797.6394,-2471.6860,1002.5284},
{3778.0747,-2452.8750,1002.5284},
{3848.7319,-2453.9375,1002.5284},
{3828.6216,-2453.9402,1015.5284},
{3797.5637,-2453.8789,1015.5284},
{3855.7751,-2472.6580,1015.5284},
{3770.3140,-2436.6235,1015.5284},
{3811.2190,-2436.3999,1015.5284}
};
if (strcmp("/DD3", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_BLUE, "You just got Teleported to Derby Map!");
new Random = random(sizeof(RandomSpawn));
SetPlayerPos(playerid, RandomSpawn[Random][0], RandomSpawn[Random][1], RandomSpawn[Random][2]);
return 1;
}
Try this should work compiled.
pawn Код:
|
new Float:RandomSpawn[][] =
{
{2580.9543,-2922.2375,1003.8871},
{2580.9353,-3040.3372,1003.8871},
{2620.9497,-2980.4980,1003.8871},
{2662.5625,-2922.4089,1003.8871},
{2682.1228,-2959.8835,1003.8871},
{2663.1399,-2999.8201,1003.8871},
{2581.3845,-2962.0913,1003.8871},
{2606.0146,-2995.0747,1003.8871},
{2601.6973,-2941.1292,1003.8871},
{2581.7783,-2959.8501,1003.8871},
{3811.2156,-2453.5735,1002.5284},
{3828.2717,-2437.7588,1002.5284},
{3797.6394,-2471.6860,1002.5284},
{3778.0747,-2452.8750,1002.5284},
{3848.7319,-2453.9375,1002.5284},
{3828.6216,-2453.9402,1015.5284},
{3797.5637,-2453.8789,1015.5284},
{3855.7751,-2472.6580,1015.5284},
{3770.3140,-2436.6235,1015.5284},
{3811.2190,-2436.3999,1015.5284}
};
if (strcmp("/DD3", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_BLUE, "You just got Teleported to Derby Map!");
new Random = random(sizeof(RandomSpawn));
SetPlayerPos(playerid, RandomSpawn[Random][0], RandomSpawn[Random][1], RandomSpawn[Random][2]);
new Float:x,Float:y,Float:z,Float:a,vehicle;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
vehicle = CreateVehicle(411,x,y,z,a,-1,1,1);
PutPlayerInVehicle(playerid,vehicle ,0);
return 1;
}
if (strcmp("/DD2", cmdtext, true, 10) == 0) { SendClientMessage(playerid, COLOR_BLUE, "You just got Teleported to Derby Map!"); new Random = random(sizeof(RandomSpawn)); SetPlayerPos(playerid, RandomSpawn[Random][0], RandomSpawn[Random][1], RandomSpawn[Random][2]); new Car = CreateVehicle(411,RandomSpawn[Random][0], RandomSpawn[Random][1], RandomSpawn[Random] [2],0,0,0,0); PutPlayerInVehicle(playerid,Car,0); SetPlayerInterior(playerid, 0); }