can someone tell me why this code is fucked up please - 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: can someone tell me why this code is fucked up please (
/showthread.php?tid=312854)
can someone tell me why this code is fucked up please -
Zonoya - 23.01.2012
pawn Код:
if(strcmp(cmd, "/Surface", true) == 0)
{
if(gTeam[playerid] == Russia)
{
if(Submerged == 1)
{
SendClientMessage(playerid, 0x0000FFFF, "The Sub is surfacing now please wait....");
MoveObject(Submarine,-3844.18, 1727.39, 4.14, 10, -4.00, 0.00);
Submerged = 0;
}
SendClientMessage(playerid, 0x0000FFFF, "Sub is already surfaced.");
}
SendClientMessage(playerid, 0x0000FFFF, "You have to be Russian to access the codes to surface.");
return 1;
}
if(strcmp(cmd, "/Submerge", true) == 0)
{
if(gTeam[playerid] == Russia)
{
if(Submerged == 0)
{
if(O2Level >100)
{
SendClientMessage(playerid, 0x0000FFFF, "The Sub is Submerging now please wait....");
MoveObject(Submarine,-3844.18, 1727.39, -10.00, 10, 0.00, 0.00);
Submerged = 1;
}
SendClientMessage(playerid, 0x0000FFFF, "Sub has not recharged its O2");
}
SendClientMessage(playerid, 0x0000FFFF, "Sub is already underwater.");
}
SendClientMessage(playerid, 0x0000FFFF, "You have to be Russian to access the codes the submerge.");
return 1;
}
well it compiles fine but when i go ingame i get the errors "Sub has not recharged its O2", "Sub is already underwater" or "You have to be russian blablablabla".
before you ask about using ZCMD or YCMD or something like that, i will change it over when i get time :P.
can someone please help me
Re: can someone tell me why this code is fucked up please -
N0FeaR - 23.01.2012
Show the errors
Re: can someone tell me why this code is fucked up please -
Shadoww5 - 23.01.2012
PHP код:
if(strcmp(cmd, "/Surface", true) == 0)
{
if(gTeam[playerid] != Russia)
return SendClientMessage(playerid, 0x0000FFFF, "You have to be Russian to access the codes to surface.");
if(Submerged != 1)
return SendClientMessage(playerid, 0x0000FFFF, "Sub is already surfaced.");
SendClientMessage(playerid, 0x0000FFFF, "The Sub is surfacing now please wait....");
MoveObject(Submarine,-3844.18, 1727.39, 4.14, 10, -4.00, 0.00);
Submerged = 0;
return 1;
}
if(strcmp(cmd, "/Submerge", true) == 0)
{
if(gTeam[playerid] != Russia)
return SendClientMessage(playerid, 0x0000FFFF, "You have to be Russian to access the codes the submerge.");
if(Submerged != 0)
return SendClientMessage(playerid, 0x0000FFFF, "Sub is already underwater.");
if(O2Level <= 100)
return SendClientMessage(playerid, 0x0000FFFF, "Sub has not recharged its O2");
SendClientMessage(playerid, 0x0000FFFF, "The Sub is Submerging now please wait....");
MoveObject(Submarine,-3844.18, 1727.39, -10.00, 10, 0.00, 0.00);
Submerged = 1;
return 1;
}
Re: can someone tell me why this code is fucked up please -
Zonoya - 23.01.2012
thx Shadoww5 repped it's working now