SA-MP Forums Archive
warning 209 - 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: warning 209 (/showthread.php?tid=608330)



warning 209 - Slawiii - 30.05.2016

Код:
C:\Users\crввzя\Desktop\satdm\gamemodes\SATDMv12.pwn(89088) : warning 209: function "AC_BS_SetPlayerArmour" should return a value
PHP код:

    
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) {
             new 
vehicle GetPlayerVehicleID(playerid);
             if(
VehicleInfo[vehicle][Security] == 1) {
            if(
PlayerInfo[playerid][Level] >= || IsPlayerAdmin(playerid)) SendClientMessageToAll(COLOR_ORANGE"This Vehicle Owner has secured it against players drive but as admin you still can use it");
                 else if(
strcmp(VehicleInfo[vehicle][owner],pName(playerid),false) == 1) {
                     new 
Float:x,Float:y,Float:z;
                     
GetPlayerPos(playerid,x,y,z); AC_BS_SetPlayerPos(playerid,x,y,z+2);
                     return 
SendClientMessage(playeridCOLOR_BRIGHTRED"This Vehicle Owner Has Secure it from players drive");
                 }
             }
             else if(
VehicleInfo[vehicle][Security] == 2) {
               if(
PlayerInfo[playerid][Level] >= || IsPlayerAdmin(playerid)) SendClientMessage(playeridCOLOR_ORANGE"This vehicle is currently set for admin use only. It will kill anyone who is not an admin.");
                 else if(
PlayerInfo[playerid][Level] == && !IsPlayerAdmin(playerid)) {
                     new 
string[128];
                     
format(stringsizeof(string), "Server administration has set this %s to kill anyone who try's to drive it...R.I.P loser!",VehicleInfo[GetPlayerVehicleID(playerid)][vName]);
                
SendClientMessage(playeridCOLOR_ORANGEstring);
                     
format(string,sizeof string,"%s just tried to steal an admin only %s and was killed by the security system...R.I.P loser!",pName(playerid));
                     
SendClientMessageToAll(COLOR_ORANGEstring);
                
AC_BS_SetPlayerHealth(playerid0.00);
                return 
AC_BS_SetPlayerArmour(playerid0.00); // line warning ( line:89088)
            
}
          }
          if(
VehicleInfo[GetPlayerVehicleID(playerid)][Temp] == 1) {
            return 
GameTextForPlayer(playerid"This vehicle is only temporary and is not for sale!"30004);
          }
          
/*
          Engine System Disabled
          new vehicleid = GetPlayerVehicleID(playerid), engine, lights1, alarm, doors, bonnet, boot, objective;
             GetVehicleParamsEx(vehicleid, engine, lights1, alarm, doors, bonnet, boot, objective);
             if(VehicleInfo[vehicleid][owned] == 0 && engine == 0) {
             SetVehicleParamsEx(vehicleid,1,lights1,alarm,doors,bonnet,boot,objective);
             return VehicleInfo[vehicleid][Engine] = 1;
          }
          if(VehicleInfo[vehicleid][owned] == 1) SetVehicleParamsEx(vehicleid,VehicleInfo[vehicleid][Engine],lights1,alarm,doors,bonnet,boot,objective);
             if(VehicleInfo[vehicleid][owned] == 1 && VehicleInfo[vehicleid][Engine] == 0)
           SendClientMessage(playerid,-1,"NOTE: This Vehicle Engine Is Turned off prees N or use /engine command to turn it on!");*/
     




Re: warning 209 - F1N4L - 30.05.2016

Not found return in the function.
Код:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) { 
             new vehicle = GetPlayerVehicleID(playerid); 
             if(VehicleInfo[vehicle][Security] == 1) { 
            if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid)) SendClientMessageToAll(COLOR_ORANGE, "This Vehicle Owner has secured it against players drive but as admin you still can use it"); 
                 else if(strcmp(VehicleInfo[vehicle][owner],pName(playerid),false) == 1) { 
                     new Float:x,Float:y,Float:z; 
                     GetPlayerPos(playerid,x,y,z); AC_BS_SetPlayerPos(playerid,x,y,z+2); 
                     return SendClientMessage(playerid, COLOR_BRIGHTRED, "This Vehicle Owner Has Secure it from players drive"); 
                 } 
             } 
             else if(VehicleInfo[vehicle][Security] == 2) { 
               if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_ORANGE, "This vehicle is currently set for admin use only. It will kill anyone who is not an admin."); 
                 else if(PlayerInfo[playerid][Level] == 0 && !IsPlayerAdmin(playerid)) { 
                     new string[128]; 
                     format(string, sizeof(string), "Server administration has set this %s to kill anyone who try's to drive it...R.I.P loser!",VehicleInfo[GetPlayerVehicleID(playerid)][vName]); 
                SendClientMessage(playerid, COLOR_ORANGE, string); 
                     format(string,sizeof string,"%s just tried to steal an admin only %s and was killed by the security system...R.I.P loser!",pName(playerid)); 
                     SendClientMessageToAll(COLOR_ORANGE, string); 
                AC_BS_SetPlayerHealth(playerid, 0.00); 
                return AC_BS_SetPlayerArmour(playerid, 0.00); // line warning ( line:89088) 
            } 
          } 
          if(VehicleInfo[GetPlayerVehicleID(playerid)][Temp] == 1) { 
            return GameTextForPlayer(playerid, "This vehicle is only temporary and is not for sale!", 3000, 4); 
          } 
          /* 
          Engine System Disabled 
          new vehicleid = GetPlayerVehicleID(playerid), engine, lights1, alarm, doors, bonnet, boot, objective; 
             GetVehicleParamsEx(vehicleid, engine, lights1, alarm, doors, bonnet, boot, objective); 
             if(VehicleInfo[vehicleid][owned] == 0 && engine == 0) { 
             SetVehicleParamsEx(vehicleid,1,lights1,alarm,doors,bonnet,boot,objective); 
             return VehicleInfo[vehicleid][Engine] = 1; 
          } 
          if(VehicleInfo[vehicleid][owned] == 1) SetVehicleParamsEx(vehicleid,VehicleInfo[vehicleid][Engine],lights1,alarm,doors,bonnet,boot,objective); 
             if(VehicleInfo[vehicleid][owned] == 1 && VehicleInfo[vehicleid][Engine] == 0) 
           SendClientMessage(playerid,-1,"NOTE: This Vehicle Engine Is Turned off prees N or use /engine command to turn it on!");*/ 
		   return 1;
     }



Re: warning 209 - Slawiii - 30.05.2016

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Not found return in the function.
Код:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) { 
             new vehicle = GetPlayerVehicleID(playerid); 
             if(VehicleInfo[vehicle][Security] == 1) { 
            if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid)) SendClientMessageToAll(COLOR_ORANGE, "This Vehicle Owner has secured it against players drive but as admin you still can use it"); 
                 else if(strcmp(VehicleInfo[vehicle][owner],pName(playerid),false) == 1) { 
                     new Float:x,Float:y,Float:z; 
                     GetPlayerPos(playerid,x,y,z); AC_BS_SetPlayerPos(playerid,x,y,z+2); 
                     return SendClientMessage(playerid, COLOR_BRIGHTRED, "This Vehicle Owner Has Secure it from players drive"); 
                 } 
             } 
             else if(VehicleInfo[vehicle][Security] == 2) { 
               if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_ORANGE, "This vehicle is currently set for admin use only. It will kill anyone who is not an admin."); 
                 else if(PlayerInfo[playerid][Level] == 0 && !IsPlayerAdmin(playerid)) { 
                     new string[128]; 
                     format(string, sizeof(string), "Server administration has set this %s to kill anyone who try's to drive it...R.I.P loser!",VehicleInfo[GetPlayerVehicleID(playerid)][vName]); 
                SendClientMessage(playerid, COLOR_ORANGE, string); 
                     format(string,sizeof string,"%s just tried to steal an admin only %s and was killed by the security system...R.I.P loser!",pName(playerid)); 
                     SendClientMessageToAll(COLOR_ORANGE, string); 
                AC_BS_SetPlayerHealth(playerid, 0.00); 
                return AC_BS_SetPlayerArmour(playerid, 0.00); // line warning ( line:89088) 
            } 
          } 
          if(VehicleInfo[GetPlayerVehicleID(playerid)][Temp] == 1) { 
            return GameTextForPlayer(playerid, "This vehicle is only temporary and is not for sale!", 3000, 4); 
          } 
          /* 
          Engine System Disabled 
          new vehicleid = GetPlayerVehicleID(playerid), engine, lights1, alarm, doors, bonnet, boot, objective; 
             GetVehicleParamsEx(vehicleid, engine, lights1, alarm, doors, bonnet, boot, objective); 
             if(VehicleInfo[vehicleid][owned] == 0 && engine == 0) { 
             SetVehicleParamsEx(vehicleid,1,lights1,alarm,doors,bonnet,boot,objective); 
             return VehicleInfo[vehicleid][Engine] = 1; 
          } 
          if(VehicleInfo[vehicleid][owned] == 1) SetVehicleParamsEx(vehicleid,VehicleInfo[vehicleid][Engine],lights1,alarm,doors,bonnet,boot,objective); 
             if(VehicleInfo[vehicleid][owned] == 1 && VehicleInfo[vehicleid][Engine] == 0) 
           SendClientMessage(playerid,-1,"NOTE: This Vehicle Engine Is Turned off prees N or use /engine command to turn it on!");*/ 
		   return 1;
     }
Thank you ..

EDIT: is The Same warning


Re: warning 209 - Sew_Sumi - 30.05.2016

Quote:
Originally Posted by Slawiii
Посмотреть сообщение
Thank you ..

EDIT: is The Same warning
That should teach you and him for copying-pasting solutions... It is a return error, and it could be further up in the statement, but seriously, fix your code, and stop relying on others to copy-paste you solutions.




Why is it NO-ONE even TRIES to fix their own issues, especially with such low grade compiler errors...


You'll also want to look at the actual function as well, rather than where it is called. in AC_BS_SetPlayerArmour.


Re: warning 209 - Slawiii - 30.05.2016

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
That should teach you and him for copying-pasting solutions... It is a return error, and it could be further up in the statement, but seriously, fix your code, and stop relying on others to copy-paste you solutions.




Why is it NO-ONE even TRIES to fix their own issues, especially with such low grade compiler errors...


You'll also want to look at the actual function as well, rather than where it is called. in AC_BS_SetPlayerArmour.
when i fix it all the command been blocked


Re: warning 209 - F1N4L - 30.05.2016

I compiled your script and the problem is the stock AC_BS_SetPlayerArmour.
return integer and float.


Re: warning 209 - Slawiii - 30.05.2016

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
I compiled your script and the problem is the stock AC_BS_SetPlayerArmour.
return integer and float.
This is Block the cmds ?


Re: warning 209 - F1N4L - 30.05.2016

Sorry.

Add a return in the function AC_BS_SetPlayerArmour

Use this (i remove the return of this function):
Код:
ot found return in the function.
Code:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) { 
             new vehicle = GetPlayerVehicleID(playerid); 
             if(VehicleInfo[vehicle][Security] == 1) { 
            if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid)) SendClientMessageToAll(COLOR_ORANGE, "This Vehicle Owner has secured it against players drive but as admin you still can use it"); 
                 else if(strcmp(VehicleInfo[vehicle][owner],pName(playerid),false) == 1) { 
                     new Float:x,Float:y,Float:z; 
                     GetPlayerPos(playerid,x,y,z); AC_BS_SetPlayerPos(playerid,x,y,z+2); 
                     return SendClientMessage(playerid, COLOR_BRIGHTRED, "This Vehicle Owner Has Secure it from players drive"); 
                 } 
             } 
             else if(VehicleInfo[vehicle][Security] == 2) { 
               if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_ORANGE, "This vehicle is currently set for admin use only. It will kill anyone who is not an admin."); 
                 else if(PlayerInfo[playerid][Level] == 0 && !IsPlayerAdmin(playerid)) { 
                     new string[128]; 
                     format(string, sizeof(string), "Server administration has set this %s to kill anyone who try's to drive it...R.I.P loser!",VehicleInfo[GetPlayerVehicleID(playerid)][vName]); 
                SendClientMessage(playerid, COLOR_ORANGE, string); 
                     format(string,sizeof string,"%s just tried to steal an admin only %s and was killed by the security system...R.I.P loser!",pName(playerid)); 
                     SendClientMessageToAll(COLOR_ORANGE, string); 
                AC_BS_SetPlayerHealth(playerid, 0.00); 
                return AC_BS_SetPlayerArmour(playerid, 0.00); // line warning ( line:89088) 
            } 
          } 
          if(VehicleInfo[GetPlayerVehicleID(playerid)][Temp] == 1) { 
            return GameTextForPlayer(playerid, "This vehicle is only temporary and is not for sale!", 3000, 4); 
          } 
          /* 
          Engine System Disabled 
          new vehicleid = GetPlayerVehicleID(playerid), engine, lights1, alarm, doors, bonnet, boot, objective; 
             GetVehicleParamsEx(vehicleid, engine, lights1, alarm, doors, bonnet, boot, objective); 
             if(VehicleInfo[vehicleid][owned] == 0 && engine == 0) { 
             SetVehicleParamsEx(vehicleid,1,lights1,alarm,doors,bonnet,boot,objective); 
             return VehicleInfo[vehicleid][Engine] = 1; 
          } 
          if(VehicleInfo[vehicleid][owned] == 1) SetVehicleParamsEx(vehicleid,VehicleInfo[vehicleid][Engine],lights1,alarm,doors,bonnet,boot,objective); 
             if(VehicleInfo[vehicleid][owned] == 1 && VehicleInfo[vehicleid][Engine] == 0) 
           SendClientMessage(playerid,-1,"NOTE: This Vehicle Engine Is Turned off prees N or use /engine command to turn it on!");*/ 
     }



Re: warning 209 - Slawiii - 30.05.2016

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Sorry.

Add a return in the function AC_BS_SetPlayerArmour

Use this (i remove the return of this function):
Код:
ot found return in the function.
Code:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) { 
             new vehicle = GetPlayerVehicleID(playerid); 
             if(VehicleInfo[vehicle][Security] == 1) { 
            if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid)) SendClientMessageToAll(COLOR_ORANGE, "This Vehicle Owner has secured it against players drive but as admin you still can use it"); 
                 else if(strcmp(VehicleInfo[vehicle][owner],pName(playerid),false) == 1) { 
                     new Float:x,Float:y,Float:z; 
                     GetPlayerPos(playerid,x,y,z); AC_BS_SetPlayerPos(playerid,x,y,z+2); 
                     return SendClientMessage(playerid, COLOR_BRIGHTRED, "This Vehicle Owner Has Secure it from players drive"); 
                 } 
             } 
             else if(VehicleInfo[vehicle][Security] == 2) { 
               if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_ORANGE, "This vehicle is currently set for admin use only. It will kill anyone who is not an admin."); 
                 else if(PlayerInfo[playerid][Level] == 0 && !IsPlayerAdmin(playerid)) { 
                     new string[128]; 
                     format(string, sizeof(string), "Server administration has set this %s to kill anyone who try's to drive it...R.I.P loser!",VehicleInfo[GetPlayerVehicleID(playerid)][vName]); 
                SendClientMessage(playerid, COLOR_ORANGE, string); 
                     format(string,sizeof string,"%s just tried to steal an admin only %s and was killed by the security system...R.I.P loser!",pName(playerid)); 
                     SendClientMessageToAll(COLOR_ORANGE, string); 
                AC_BS_SetPlayerHealth(playerid, 0.00); 
                return AC_BS_SetPlayerArmour(playerid, 0.00); // line warning ( line:89088) 
            } 
          } 
          if(VehicleInfo[GetPlayerVehicleID(playerid)][Temp] == 1) { 
            return GameTextForPlayer(playerid, "This vehicle is only temporary and is not for sale!", 3000, 4); 
          } 
          /* 
          Engine System Disabled 
          new vehicleid = GetPlayerVehicleID(playerid), engine, lights1, alarm, doors, bonnet, boot, objective; 
             GetVehicleParamsEx(vehicleid, engine, lights1, alarm, doors, bonnet, boot, objective); 
             if(VehicleInfo[vehicleid][owned] == 0 && engine == 0) { 
             SetVehicleParamsEx(vehicleid,1,lights1,alarm,doors,bonnet,boot,objective); 
             return VehicleInfo[vehicleid][Engine] = 1; 
          } 
          if(VehicleInfo[vehicleid][owned] == 1) SetVehicleParamsEx(vehicleid,VehicleInfo[vehicleid][Engine],lights1,alarm,doors,bonnet,boot,objective); 
             if(VehicleInfo[vehicleid][owned] == 1 && VehicleInfo[vehicleid][Engine] == 0) 
           SendClientMessage(playerid,-1,"NOTE: This Vehicle Engine Is Turned off prees N or use /engine command to turn it on!");*/ 
     }
you mean return 0;


Re: warning 209 - Sew_Sumi - 31.05.2016

Quote:
Originally Posted by Slawiii
Посмотреть сообщение
when i fix it all the command been blocked
That could be related to another issue.