if(strcmp(cmdtext, "/rocket", true) == 0) { if (RandomSpawn == 0) { InCar[playerid] = false; SetPlayerPos(playerid,2618.1104,2721.5310,36.5386); SetPlayerFacingAngle(playerid, 182.8171); SetCameraBehindPlayer(playerid); } if (RandomSpawn == 1) { InCar[playerid] = false; SetPlayerPos(playerid,2608.7087,2769.7107,23.8222); SetPlayerFacingAngle(playerid,179.0337); SetCameraBehindPlayer(playerid); } if (RandomSpawn == 2) { InCar[playerid] = false; SetPlayerPos(playerid, 2652.5449,2699.1731,19.3222); SetPlayerFacingAngle(playerid, 12.9889); SetCameraBehindPlayer(playerid); }
if(strcmp(cmdtext, "/rocket", true) == 0)
{
switch(random(3)) {
case 0:
{
InCar[playerid] = false;
SetPlayerPos(playerid,2618.1104,2721.5310,36.5386);
SetPlayerFacingAngle(playerid, 182.8171);
SetCameraBehindPlayer(playerid);
return 1;
}
case 1:
{
InCar[playerid] = false;
SetPlayerPos(playerid,2608.7087,2769.7107,23.8222);
SetPlayerFacingAngle(playerid,179.0337);
SetCameraBehindPlayer(playerid);
return 1;
}
case 2:
{
InCar[playerid] = false;
SetPlayerPos(playerid, 2652.5449,2699.1731,19.3222);
SetPlayerFacingAngle(playerid, 12.9889);
SetCameraBehindPlayer(playerid);
return 1;
}
}
return 1;
}
So, what are you trying to do ? How do you get the RandomSpawn varible ? What's happening when you type /rocket etc.
|
pawn Код:
|
C:\Program Files (x86)\Rockstar Games\GTA Server\gamemodes\v2.0.pwn(2628) : error 002: only a single statement (or expression) can follow each "case" C:\Program Files (x86)\Rockstar Games\GTA Server\gamemodes\v2.0.pwn(2628 -- 2629) : error 028: invalid subscript (not an array or too many subscripts): "random" C:\Program Files (x86)\Rockstar Games\GTA Server\gamemodes\v2.0.pwn(2628 -- 2630) : error 001: expected token: "}", but found "case" C:\Program Files (x86)\Rockstar Games\GTA Server\gamemodes\v2.0.pwn(2628 -- 2630) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
if(dialogid==600 && response==1) { switch(listitem) { case 0: { ShowPlayerDialog(playerid, 601, DIALOG_STYLE_LIST, "Los Santos", "Los Santos Airport\nABC\nDEF\nABC\nDEF\nABC", "Kies", "Annuleren"); } case 1: { ShowPlayerDialog(playerid, 602, DIALOG_STYLE_LIST, "San Fiero", "San Fiero Airport\nABC\nDEF\nABC\nDEF\nABC", "Kies", "Annuleren"); } case 2: { ShowPlayerDialog(playerid, 603, DIALOG_STYLE_LIST, "Las Ventures", "Las Ventures Airport\nABC\nDEF\nABC\nDEF\nABC", "Kies", "Annuleren"); } case 3: { ShowPlayerDialog(playerid, 604, DIALOG_STYLE_LIST, "Deathmatch", "Militair Base\nArea 69\nAlcatraz\nABC\nDEF\nABC", "Kies", "Annuleren"); } case 4: { ShowPlayerDialog(playerid, 605, DIALOG_STYLE_LIST, "Andere", "Trans Fender\nLoco Low Co\nWheels Arch Angels\nABC\nDEF\nABC", "Kies", "Annuleren"); } } } if(dialogid==604 && response==1) { switch(listitem) { case 0: { switch(random(10)) { case 0: { //InCar[playerid] = false; SetPlayerPos(playerid, 2612.036,2773.789,23.822); SetPlayerFacingAngle(playerid, 182.8171); SetCameraBehindPlayer(playerid); return 1; } case 1: { //InCar[playerid] = false; SetPlayerPos(playerid, 2619.452, 2720.364, 36.538); SetPlayerFacingAngle(playerid,179.0337); SetCameraBehindPlayer(playerid); return 1; } case 2: { //InCar[playerid] = false; SetPlayerPos(playerid, 2608.844, 2811.772, 27.820); SetPlayerFacingAngle(playerid, 12.9889); SetCameraBehindPlayer(playerid); return 1; } case 3: { //InCar[playerid] = false; SetPlayerPos(playerid, 2668.729, 2822.054, 36.322); SetPlayerFacingAngle(playerid, 182.8171); SetCameraBehindPlayer(playerid); return 1; } case 4: { //InCar[playerid] = false; SetPlayerPos(playerid, 2718.204, 2773.818, 77.359); SetPlayerFacingAngle(playerid,179.0337); SetCameraBehindPlayer(playerid); return 1; } case 5: { //InCar[playerid] = false; SetPlayerPos(playerid, 2687.908, 2727.094, 10.820); SetPlayerFacingAngle(playerid, 12.9889); SetCameraBehindPlayer(playerid); return 1; } case 6: { //InCar[playerid] = false; SetPlayerPos(playerid, 2500.135, 2807.884, 14.822); SetPlayerFacingAngle(playerid, 182.8171); SetCameraBehindPlayer(playerid); return 1; } case 7: { //InCar[playerid] = false; SetPlayerPos(playerid, 2613.776, 2805.445, 19.992); SetPlayerFacingAngle(playerid,179.0337); SetCameraBehindPlayer(playerid); return 1; } case 8: { //InCar[playerid] = false; SetPlayerPos(playerid, 2542.962, 2810.358, 10.820); SetPlayerFacingAngle(playerid, 12.9889); SetCameraBehindPlayer(playerid); return 1; } case 9: { //InCar[playerid] = false; SetPlayerPos(playerid, 2638.989, 2848.554, 10.820); SetPlayerFacingAngle(playerid, 12.9889); SetCameraBehindPlayer(playerid); return 1; } } } case 1: { switch(listitem) { switch(random(10)) { case 0: { //InCar[playerid] = false; SetPlayerPos(playerid, 282.249, 1957.423, 17.640); SetPlayerFacingAngle(playerid, 182.8171); SetCameraBehindPlayer(playerid); return 1; } case 1: { //InCar[playerid] = false; SetPlayerPos(playerid, 269.125, 1894.715, 33.898); SetPlayerFacingAngle(playerid,179.0337); SetCameraBehindPlayer(playerid); return 1; } case 2: { //InCar[playerid] = false; SetPlayerPos(playerid, 223.346, 1931.671, 17.640); SetPlayerFacingAngle(playerid, 12.9889); SetCameraBehindPlayer(playerid); return 1; } case 3: { //InCar[playerid] = false; SetPlayerPos(playerid, 216.341, 1861.328, 13.140); SetPlayerFacingAngle(playerid, 182.8171); SetCameraBehindPlayer(playerid); return 1; } case 4: { //InCar[playerid] = false; SetPlayerPos(playerid, 261.022, 1865.739, 8.757); SetPlayerFacingAngle(playerid,179.0337); SetCameraBehindPlayer(playerid); return 1; } case 5: { //InCar[playerid] = false; SetPlayerPos(playerid, 254.109, 1836.606, 4.710); SetPlayerFacingAngle(playerid, 12.9889); SetCameraBehindPlayer(playerid); return 1; } case 6: { //InCar[playerid] = false; SetPlayerPos(playerid, 259.902, 1816.855, 1.007); SetPlayerFacingAngle(playerid, 182.8171); SetCameraBehindPlayer(playerid); return 1; } case 7: { //InCar[playerid] = false; SetPlayerPos(playerid, 276.486, 1871.990, 8.764); SetPlayerFacingAngle(playerid,179.0337); SetCameraBehindPlayer(playerid); return 1; } case 8: { //InCar[playerid] = false; SetPlayerPos(playerid, 268.557, 1875.734, 8.437); SetPlayerFacingAngle(playerid, 12.9889); SetCameraBehindPlayer(playerid); return 1; } case 9: { //InCar[playerid] = false; SetPlayerPos(playerid, 268.580, 1883.842, -30.093); SetPlayerFacingAngle(playerid, 12.9889); SetCameraBehindPlayer(playerid); return 1; } } } case 2: { switch(listitem) { switch(random(10)) { case 0: { //InCar[playerid] = false; SetPlayerPos(playerid, 3248.780,-2048.949,18.032); SetPlayerFacingAngle(playerid, 182.8171); SetCameraBehindPlayer(playerid); return 1; } case 1: { //InCar[playerid] = false; SetPlayerPos(playerid, 3267.280,-1953.686,25.288); SetPlayerFacingAngle(playerid,179.0337); SetCameraBehindPlayer(playerid); return 1; } case 2: { //InCar[playerid] = false; SetPlayerPos(playerid, 3293.949,-1969.467,14.615); SetPlayerFacingAngle(playerid, 12.9889); SetCameraBehindPlayer(playerid); return 1; } case 3: { //InCar[playerid] = false; SetPlayerPos(playerid, 3304.193,-2053.547,17.501); SetPlayerFacingAngle(playerid, 182.8171); SetCameraBehindPlayer(playerid); return 1; } case 4: { //InCar[playerid] = false; SetPlayerPos(playerid, 3337.033,-2099.723,22.364); SetPlayerFacingAngle(playerid,179.0337); SetCameraBehindPlayer(playerid); return 1; } case 5: { //InCar[playerid] = false; SetPlayerPos(playerid, 3318.687,-2122.700,35.732); SetPlayerFacingAngle(playerid, 12.9889); SetCameraBehindPlayer(playerid); return 1; } case 6: { //InCar[playerid] = false; SetPlayerPos(playerid, 3292.989,-2167.310,24.015); SetPlayerFacingAngle(playerid, 182.8171); SetCameraBehindPlayer(playerid); return 1; } case 7: { //InCar[playerid] = false; SetPlayerPos(playerid, 3292.864,-2167.992,28.115); SetPlayerFacingAngle(playerid,179.0337); SetCameraBehindPlayer(playerid); return 1; } case 8: { //InCar[playerid] = false; SetPlayerPos(playerid, 3280.509,-2178.558,30.048); SetPlayerFacingAngle(playerid, 12.9889); SetCameraBehindPlayer(playerid); return 1; } case 9: { //InCar[playerid] = false; SetPlayerPos(playerid, 3281.068,-2163.014,20.362); SetPlayerFacingAngle(playerid, 12.9889); SetCameraBehindPlayer(playerid); return 1; } case 10: { //InCar[playerid] = false; SetPlayerPos(playerid, 3311.403,-2166.011,66.734); SetPlayerFacingAngle(playerid, 12.9889); SetCameraBehindPlayer(playerid); return 1; } } } case 3: { ShowPlayerDialog(playerid, 604, DIALOG_STYLE_LIST, "Deathmatch", "4", "Kies", "Annuleren"); } case 4: { ShowPlayerDialog(playerid, 605, DIALOG_STYLE_LIST, "Andere", "5", "Kies", "Annuleren"); } }
if(strcmp(cmdtext, "/rocket", true) == 0) { switch(random(3)) { case 0: { InCar[playerid] = false; SetPlayerPos(playerid,2618.1104,2721.5310,36.5386); SetPlayerFacingAngle(playerid, 182.8171); SetCameraBehindPlayer(playerid); } case 1: { InCar[playerid] = false; SetPlayerPos(playerid,2608.7087,2769.7107,23.8222); SetPlayerFacingAngle(playerid,179.0337); SetCameraBehindPlayer(playerid); } case 2: { InCar[playerid] = false; SetPlayerPos(playerid, 2652.5449,2699.1731,19.3222); SetPlayerFacingAngle(playerid, 12.9889); SetCameraBehindPlayer(playerid); } } return 1; }
Try kostas' script without the return 1's in the cases:
Код:
if(strcmp(cmdtext, "/rocket", true) == 0) { switch(random(3)) { case 0: { InCar[playerid] = false; SetPlayerPos(playerid,2618.1104,2721.5310,36.5386); SetPlayerFacingAngle(playerid, 182.8171); SetCameraBehindPlayer(playerid); } case 1: { InCar[playerid] = false; SetPlayerPos(playerid,2608.7087,2769.7107,23.8222); SetPlayerFacingAngle(playerid,179.0337); SetCameraBehindPlayer(playerid); } case 2: { InCar[playerid] = false; SetPlayerPos(playerid, 2652.5449,2699.1731,19.3222); SetPlayerFacingAngle(playerid, 12.9889); SetCameraBehindPlayer(playerid); } } return 1; } |