/escape Help (error fix) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /escape Help (error fix) (
/showthread.php?tid=575378)
/escape Help (error fix) -
Charalambos26 - 26.05.2015
Hello, i found an error on this command:
Код HTML:
CMD:escape(playerid, params[])
{
if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can use this command.");
if(IsJailed{playerid} == false) return SendClientMessage(playerid, RED, "Your not in jail.");
//if(CanESC{playerid} == false) return SendClientMessage(playerid, RED, "Plsease wait before trying to escape jail again.");//
new escrand = random(5);
switch(escrand)
{
case 0:
{
SetPlayerHealth(playerid, 100.0);
SetPlayerInterior(playerid, 3);
SetPlayerPos(playerid, 200.6972, 168.2653, 1003.0234);
SetPlayerFacingAngle(playerid, 89.0391);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 6);
PlayerInfo[playerid][pCrimes] ++;
format(fstr, sizeof(fstr),"[DISPATCH]: Suspect %s [%d] has just escaped jail at LVPD.", GetName(playerid), playerid);
CopRadio(BLUE, fstr);
SendClientMessage(playerid, LIGHTGREEN, "You have escaped jail!");
format(fstr2, sizeof(fstr2), "%s [%d] has just escaped jail at LVPD.", GetName(playerid), playerid);
SendClientMessageToAll(RED, fstr2);
SendClientMessage(playerid, RED, "County jail escape. [WANTED LEVEL INCREASED]");
IsJailed{playerid} = false;
KillTimer(JailTimer[playerid]);
JailTime[playerid] = 0;
PlayerInfo[playerid][jTime] = 0;
if(IsPlayerConnected(playerid) && IsLoggedIn{playerid} == 1)
{
SaveUserStats(playerid);
}
}
return true;
}
Код HTML:
C:\Users\Charalambos\Desktop\NVCNR\gamemodes\NVCNR.pwn(20182) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\Charalambos\Desktop\NVCNR\gamemodes\NVCNR.pwn(20182) : warning 215: expression has no effect
C:\Users\Charalambos\Desktop\NVCNR\gamemodes\NVCNR.pwn(20183) : warning 209: function "cmd_escape" should return a value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
What did i do wrong? and how can i fix it.
King Regards,
Re: /escape Help (error fix) -
FplayerGR - 26.05.2015
Код:
CMD:escape(playerid, params[])
{
if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can use this command.");
if(IsJailed{playerid} == false) return SendClientMessage(playerid, RED, "Your not in jail.");
//if(CanESC{playerid} == false) return SendClientMessage(playerid, RED, "Plsease wait before trying to escape jail again.");//
new escrand = random(5);
switch(escrand)
{
case 0:
{
SetPlayerHealth(playerid, 100.0);
SetPlayerInterior(playerid, 3);
SetPlayerPos(playerid, 200.6972, 168.2653, 1003.0234);
SetPlayerFacingAngle(playerid, 89.0391);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 6);
PlayerInfo[playerid][pCrimes] ++;
format(fstr, sizeof(fstr),"[DISPATCH]: Suspect %s [%d] has just escaped jail at LVPD.", GetName(playerid), playerid);
CopRadio(BLUE, fstr);
SendClientMessage(playerid, LIGHTGREEN, "You have escaped jail!");
format(fstr2, sizeof(fstr2), "%s [%d] has just escaped jail at LVPD.", GetName(playerid), playerid);
SendClientMessageToAll(RED, fstr2);
SendClientMessage(playerid, RED, "County jail escape. [WANTED LEVEL INCREASED]");
IsJailed{playerid} = false;
KillTimer(JailTimer[playerid]);
JailTime[playerid] = 0;
PlayerInfo[playerid][jTime] = 0;
if(IsPlayerConnected(playerid) && IsLoggedIn{playerid} == 1)
{
SaveUserStats(playerid);
}
}
}
return true;
}