new Float:SDM1[][] =
{
{2321.2295,1091.7527,79.5547,200.2727}, // SDM1 1st Spawn Pos
{2225.3442,1113.3691,64.9291,85.5682}, // SDM1 2nd Spawn Pos
{2279.4407,1112.3759,57.6250,105.3083}, // SDM1 3st Spawn Pos
{2196.1343,1004.8544,79.5547,175.1823}, // SDM1 4th Spawn Pos
{2275.6519,1111.6068,71.2844,312.7136}, // SDM1 5th Spawn Pos
{2228.8796,1109.1208,64.8463,216.2060} // SDM1 6th Spawn Pos
};
if (strcmp("/sdm", cmdtext, true, 10) == 0)
{
new Random = random(sizeof(SDM1));
SetPlayerPos(playerid, SDM1[Random][0], SDM1[Random][1], SDM1[Random][2]);
SetPlayerFacingAngle(playerid, SDM1[Random][3]);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SetPlayerSkin(playerid,137);
GivePlayerWeapon(playerid, 34, 99999);
GivePlayerWeapon(playerid, 46, 1);
}
return 1;
E:\GTA\gamemodes\mg.pwn(111) : error 017: undefined symbol "SDM1"
E:\GTA\gamemodes\mg.pwn(111) : error 029: invalid expression, assumed zero
E:\GTA\gamemodes\mg.pwn(111) : warning 215: expression has no effect
E:\GTA\gamemodes\mg.pwn(112) : error 017: undefined symbol "SDM1"
E:\GTA\gamemodes\mg.pwn(112) : warning 215: expression has no effect
E:\GTA\gamemodes\mg.pwn(112) : error 001: expected token: ";", but found "]"
E:\GTA\gamemodes\mg.pwn(112) : error 029: invalid expression, assumed zero
E:\GTA\gamemodes\mg.pwn(112) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
6 Errors.
public OnGameModeInit()
{
SetGameModeText("Mini Games Script");
AddPlayerClass(2 , 1628.6528,-2290.0068,94.1270,215.9542, 24,9999, 26, 9999,28, 9999); //Case 0 .
AddPlayerClass(264, 1210.7349,-2036.7631,69.0078,270.1496, 24,9999, 26, 9999,28, 9999);//Case 1 .
AddPlayerClass(102, 2111.3210,1258.4351,10.8203,107.3569, 24,9999, 26, 9999,28, 9999);//Case 2
AddPlayerClass(102, 2112.4336,1152.0609,13.5166,61.5863, 24,9999, 26, 9999,28, 9999);//Case 3
AddPlayerClass(115, -1383.6305,680.5055,84.0078,188.0059, 24,9999, 26, 9999,28, 9999);//Case 4
AddPlayerClass(268, -1544.6187,699.6717,148.2734,247.4590, 24,9999, 26, 9999,28, 9999);//Case 5
AddPlayerClass(138, -1544.6187,699.6717,148.2734,247.4590, 24,9999, 26, 9999,28, 9999);//Case 6
AddPlayerClass(154, 2230.8042,-2460.3716,61.6104,279.1390, 24,9999, 26, 9999,28, 9999);//Case 7
AddPlayerClass(195, 1472.3932,-2286.8137,42.0187,90.4601, 24,9999, 26, 9999,28, 9999);//Case 8
AddPlayerClass(85 , 1822.1333,-1682.5481,13.3828,88.4118, 24,9999, 26, 9999,28, 9999);//Case 9
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
switch(classid) {
case 0:
SetPlayerPos(playerid,1628.6528,-2290.0068,94.1270,215.9542);
SetPlayerCameraPos(playerid, 1628.6528,-2290.0068,94.1270,215.9542);
SetPlayerCameraLookAt(playerid,1628.6528,-2290.0068,94.1270,215.9542);
case 1:
SetPlayerPos(playerid,1210.7349,-2036.7631,69.0078,270.1496);
SetPlayerCameraPos(playerid, 1210.7349,-2036.7631,69.0078,270.1496);
SetPlayerCameraLookAt(playerid,1210.7349,-2036.7631,69.0078,270.1496);
case 2:
SetPlayerPos(playerid,2111.3210,1258.4351,10.8203,107.3569);
SetPlayerCameraPos(playerid,2111.3210,1258.4351,10.8203,107.3569);
SetPlayerCameraLookAt(playerid,2111.3210,1258.4351,10.8203,107.3569);
case 3:
SetPlayerPos(playerid,2112.4336,1152.0609,13.5166,61.5863);
SetPlayerCameraPos(playerid,2112.4336,1152.0609,13.5166,61.5863);
SetPlayerCameraLookAt(playerid,2112.4336,1152.0609,13.5166,61.5863);
case 4:
SetPlayerPos(playerid,-1383.6305,680.5055,84.0078,188.0059 );
SetPlayerCameraPos(playerid, -1383.6305,680.5055,84.0078,188.0059);
SetPlayerCameraLookAt(playerid,-1383.6305,680.5055,84.0078,188.0059 );
case 5:
SetPlayerPos(playerid,-1544.6187,699.6717,148.2734,247.4590 );
SetPlayerCameraPos(playerid,-1544.6187,699.6717,148.2734,247.4590 );
SetPlayerCameraLookAt(playerid,-1544.6187,699.6717,148.2734,247.4590 );
case 6:
SetPlayerPos(playerid,-1544.6187,699.6717,148.2734,247.4590 );
SetPlayerCameraPos(playerid,-1544.6187,699.6717,148.2734,247.4590 );
SetPlayerCameraLookAt(playerid, -1544.6187,699.6717,148.2734,247.4590);
case 7:
SetPlayerPos(playerid,2230.8042,-2460.3716,61.6104,279.1390 );
SetPlayerCameraPos(playerid,2230.8042,-2460.3716,61.6104,279.1390 );
SetPlayerCameraLookAt(playerid, 2230.8042,-2460.3716,61.6104,279.1390);
case 8:
SetPlayerPos(playerid,1472.3932,-2286.8137,42.0187,90.4601 );
SetPlayerCameraPos(playerid,1472.3932,-2286.8137,42.0187,90.4601 );
SetPlayerCameraLookAt(playerid, 1472.3932,-2286.8137,42.0187,90.4601);
case 9:
SetPlayerPos(playerid,1822.1333,-1682.5481,13.3828,88.4118 );
SetPlayerCameraPos(playerid,1822.1333,-1682.5481,13.3828,88.4118 );
SetPlayerCameraLookAt(playerid, 1822.1333,-1682.5481,13.3828,88.4118);
}
}
E:\GTA\gamemodes\mg.pwn(68) : warning 202: number of arguments does not match definition
E:\GTA\gamemodes\mg.pwn(69) : error 002: only a single statement (or expression) can follow each "case"
E:\GTA\gamemodes\mg.pwn(69) : warning 215: expression has no effect
E:\GTA\gamemodes\mg.pwn(70) : warning 213: tag mismatch
E:\GTA\gamemodes\mg.pwn(71) : warning 217: loose indentation
E:\GTA\gamemodes\mg.pwn(71) : error 014: invalid statement; not in switch
E:\GTA\gamemodes\mg.pwn(71) : warning 215: expression has no effect
E:\GTA\gamemodes\mg.pwn(71) : error 001: expected token: ";", but found ":"
E:\GTA\gamemodes\mg.pwn(71) : error 029: invalid expression, assumed zero
E:\GTA\gamemodes\mg.pwn(71) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
public OnPlayerRequestClass(playerid, classid) { switch(classid) { case 0: { SetPlayerPos(playerid,1628.6528,-2290.0068,94.1270,215.9542); SetPlayerCameraPos(playerid, 1628.6528,-2290.0068,94.1270,215.9542); SetPlayerCameraLookAt(playerid,1628.6528,-2290.0068,94.1270,215.9542); } case 1: { SetPlayerPos(playerid,1210.7349,-2036.7631,69.0078,270.1496); SetPlayerCameraPos(playerid, 1210.7349,-2036.7631,69.0078,270.1496); SetPlayerCameraLookAt(playerid,1210.7349,-2036.7631,69.0078,270.1496); } case 2: { SetPlayerPos(playerid,2111.3210,1258.4351,10.8203,107.3569); SetPlayerCameraPos(playerid,2111.3210,1258.4351,10.8203,107.3569); SetPlayerCameraLookAt(playerid,2111.3210,1258.4351,10.8203,107.3569); } case 3: { SetPlayerPos(playerid,2112.4336,1152.0609,13.5166,61.5863); SetPlayerCameraPos(playerid,2112.4336,1152.0609,13.5166,61.5863); SetPlayerCameraLookAt(playerid,2112.4336,1152.0609,13.5166,61.5863); } case 4: { SetPlayerPos(playerid,-1383.6305,680.5055,84.0078,188.0059 ); SetPlayerCameraPos(playerid, -1383.6305,680.5055,84.0078,188.0059); SetPlayerCameraLookAt(playerid,-1383.6305,680.5055,84.0078,188.0059 ); } case 5: { SetPlayerPos(playerid,-1544.6187,699.6717,148.2734,247.4590 ); SetPlayerCameraPos(playerid,-1544.6187,699.6717,148.2734,247.4590 ); SetPlayerCameraLookAt(playerid,-1544.6187,699.6717,148.2734,247.4590 ); } case 6: { SetPlayerPos(playerid,-1544.6187,699.6717,148.2734,247.4590 ); SetPlayerCameraPos(playerid,-1544.6187,699.6717,148.2734,247.4590 ); SetPlayerCameraLookAt(playerid, -1544.6187,699.6717,148.2734,247.4590); } case 7: { SetPlayerPos(playerid,2230.8042,-2460.3716,61.6104,279.1390 ); SetPlayerCameraPos(playerid,2230.8042,-2460.3716,61.6104,279.1390 ); SetPlayerCameraLookAt(playerid, 2230.8042,-2460.3716,61.6104,279.1390); } case 8: { SetPlayerPos(playerid,1472.3932,-2286.8137,42.0187,90.4601 ); SetPlayerCameraPos(playerid,1472.3932,-2286.8137,42.0187,90.4601 ); SetPlayerCameraLookAt(playerid, 1472.3932,-2286.8137,42.0187,90.4601); } case 9: { SetPlayerPos(playerid,1822.1333,-1682.5481,13.3828,88.4118 ); SetPlayerCameraPos(playerid,1822.1333,-1682.5481,13.3828,88.4118 ); SetPlayerCameraLookAt(playerid, 1822.1333,-1682.5481,13.3828,88.4118); } } }
If u can please tell me what to do.
I mean tell me the Right Code and i will replace it. And why Only case 0 and case 1 have errors?? |
Function param1 param2 param3 param4 SetPlayerPos(playerid, Float:x, Float:y, Float:z)
public OnPlayerRequestClass(playerid, classid)
{
switch(classid) {
case 0:
SetPlayerPos(playerid,1628.6528,-2290.0068,94.1270);
SetPlayerCameraPos(playerid, 1628.6528,-2290.0068,94.1270);
SetPlayerCameraLookAt(playerid,1628.6528,-2290.0068,94.1270);
case 1:
SetPlayerPos(playerid,1210.7349,-2036.7631,69.0078);
SetPlayerCameraPos(playerid, 1210.7349,-2036.7631,69.0078);
SetPlayerCameraLookAt(playerid,1210.7349,-2036.7631,69.0078);
case 2:
SetPlayerPos(playerid,2111.3210,1258.4351,10.8203);
SetPlayerCameraPos(playerid,2111.3210,1258.4351,10.8203);
SetPlayerCameraLookAt(playerid,2111.3210,1258.4351,10.8203);
case 3:
SetPlayerPos(playerid,2112.4336,1152.0609,13.5166);
SetPlayerCameraPos(playerid,2112.4336,1152.0609,13.5166);
SetPlayerCameraLookAt(playerid,2112.4336,1152.0609,13.5166);
case 4:
SetPlayerPos(playerid,-1383.6305,680.5055,84.0078 );
SetPlayerCameraPos(playerid, -1383.6305,680.5055,84.0078);
SetPlayerCameraLookAt(playerid,-1383.6305,680.5055,84.0078);
case 5:
SetPlayerPos(playerid,-1544.6187,699.6717,148.2734);
SetPlayerCameraPos(playerid,-1544.6187,699.6717,148.2734);
SetPlayerCameraLookAt(playerid,-1544.6187,699.6717,148.2734);
case 6:
SetPlayerPos(playerid,-1544.6187,699.6717,148.2734);
SetPlayerCameraPos(playerid,-1544.6187,699.6717,148.2734);
SetPlayerCameraLookAt(playerid, -1544.6187,699.6717,148.2734);
case 7:
SetPlayerPos(playerid,2230.8042,-2460.3716,61.6104);
SetPlayerCameraPos(playerid,2230.8042,-2460.3716,61.6104);
SetPlayerCameraLookAt(playerid, 2230.8042,-2460.3716,61.6104);
case 8:
SetPlayerPos(playerid,1472.3932,-2286.8137,42.0187);
SetPlayerCameraPos(playerid,1472.3932,-2286.8137,42.0187);
SetPlayerCameraLookAt(playerid, 1472.3932,-2286.8137,42.0187);
case 9:
SetPlayerPos(playerid,1822.1333,-1682.5481,13.3828);
SetPlayerCameraPos(playerid,1822.1333,-1682.5481,13.3828);
SetPlayerCameraLookAt(playerid, 1822.1333,-1682.5481,13.3828);
}
}
E:\GTA\gamemodes\mg.pwn(69) : error 002: only a single statement (or expression) can follow each "case"
E:\GTA\gamemodes\mg.pwn(69) : warning 215: expression has no effect
E:\GTA\gamemodes\mg.pwn(71) : warning 217: loose indentation
E:\GTA\gamemodes\mg.pwn(71) : error 014: invalid statement; not in switch
E:\GTA\gamemodes\mg.pwn(71) : warning 215: expression has no effect
E:\GTA\gamemodes\mg.pwn(71) : error 001: expected token: ";", but found ":"
E:\GTA\gamemodes\mg.pwn(71) : error 029: invalid expression, assumed zero
E:\GTA\gamemodes\mg.pwn(71) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
public OnPlayerRequestClass(playerid, classid)
{
switch(classid) {
case 0:
{
SetPlayerPos(playerid,1628.6528,-2290.0068,94.1270);
SetPlayerCameraPos(playerid, 1628.6528,-2290.0068,94.1270);
SetPlayerCameraLookAt(playerid,1628.6528,-2290.0068,94.1270);
}
case 1:
{
SetPlayerPos(playerid,1210.7349,-2036.7631,69.0078);
SetPlayerCameraPos(playerid, 1210.7349,-2036.7631,69.0078);
SetPlayerCameraLookAt(playerid,1210.7349,-2036.7631,69.0078);
}
case 2:
{
SetPlayerPos(playerid,2111.3210,1258.4351,10.8203);
SetPlayerCameraPos(playerid,2111.3210,1258.4351,10.8203);
SetPlayerCameraLookAt(playerid,2111.3210,1258.4351,10.8203);
}
case 3:
{
SetPlayerPos(playerid,2112.4336,1152.0609,13.5166);
SetPlayerCameraPos(playerid,2112.4336,1152.0609,13.5166);
SetPlayerCameraLookAt(playerid,2112.4336,1152.0609,13.5166);
}
case 4:
{
SetPlayerPos(playerid,-1383.6305,680.5055,84.0078 );
SetPlayerCameraPos(playerid, -1383.6305,680.5055,84.0078);
SetPlayerCameraLookAt(playerid,-1383.6305,680.5055,84.0078);
}
case 5:
{
SetPlayerPos(playerid,-1544.6187,699.6717,148.2734);
SetPlayerCameraPos(playerid,-1544.6187,699.6717,148.2734);
SetPlayerCameraLookAt(playerid,-1544.6187,699.6717,148.2734);
}
case 6:
{
SetPlayerPos(playerid,-1544.6187,699.6717,148.2734);
SetPlayerCameraPos(playerid,-1544.6187,699.6717,148.2734);
SetPlayerCameraLookAt(playerid, -1544.6187,699.6717,148.2734);
}
case 7:
{
SetPlayerPos(playerid,2230.8042,-2460.3716,61.6104);
SetPlayerCameraPos(playerid,2230.8042,-2460.3716,61.6104);
SetPlayerCameraLookAt(playerid, 2230.8042,-2460.3716,61.6104);
}
case 8:
{
SetPlayerPos(playerid,1472.3932,-2286.8137,42.0187);
SetPlayerCameraPos(playerid,1472.3932,-2286.8137,42.0187);
SetPlayerCameraLookAt(playerid, 1472.3932,-2286.8137,42.0187);
}
case 9:
{
SetPlayerPos(playerid,1822.1333,-1682.5481,13.3828);
SetPlayerCameraPos(playerid,1822.1333,-1682.5481,13.3828);
SetPlayerCameraLookAt(playerid, 1822.1333,-1682.5481,13.3828);
}
}
return true;
}
Now?? :
PHP код:
PHP код:
|
//CORRECT FORM 1 //Only one function in this case. case 0: SetPlayerPos(playerid,1628.6528,-2290.0068,94.1270);
//CORRECT FORM 1 //More than one function case 0: { SetPlayerPos(playerid,1628.6528,-2290.0068,94.1270); SetPlayerCameraPos(playerid, 1628.6528,-2290.0068,94.1270); SetPlayerCameraLookAt(playerid,1628.6528,-2290.0068,94.1270); }