Ayudita con CMD
#1

Ayudita con estos errores, es un strcmp que intente pasar a cmd:

Код:
CMD:sirena(playerid, params[])
{
    if(Team_Traficante(playerid))
	if(sscanf(params, "s[10]", params[0])) return SendClientMessage(playerid, -1, "/obtener semillas, /obtener crack");
    new Siren[65];
    new VID = GetPlayerVehicleID(playerid);
	if(strcmp(siren, "inside", params[0], true) == 0)
      {
         if(Siren[VID] == 0);
                    {
                        Siren[VID] = 1;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        SirenObject[VID] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
                        AttachObjectToVehicle(SirenObject[VID], VID, 0.0, 0.75, 0.275, 0.0, 0.1, 0.0);
                        format(string, sizeof(string), "* %s pone una sirena atras del volante.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    } else { return SendClientMessage(playerid, COLOR_GREY, "This vehicle already has a siren!"); }
                }
                else if(strcmp(siren, "roof", params[0], true) == 0)
                {
                    if(Siren[VID] == 0)
                    {
                        Siren[VID] = 1;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        SirenObject[VID] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
                        AttachObjectToVehicle(SirenObject[VID], VID, -0.43, 0.0, 0.785, 0.0, 0.1, 0.0);
                        format(string, sizeof(string), "* %s pone la sirena en el techo del coche.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    } else { return SendClientMessage(playerid, COLOR_GREY, "This vehicle already has a siren!"); }
                }
                else if(strcmp(siren, "off", params[0], true) == 0)
                {
                    if(Siren[VID] == 1)
                    {
                    	Siren[VID] = 0;
                    	GetPlayerName(playerid, sendername, sizeof(sendername));
                    	DestroyObject(SirenObject[VID]);
                    	format(string, sizeof(string), "* %s guarda la sirena.", sendername);
                    	ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    } else { return SendClientMessage(playerid, COLOR_GREY, "No puedes ponersela a este coche!"); }
                }
            } else { SendClientMessage(playerid, COLOR_GREY, "   Solo agentes"); }
        }
    return 1;
}
los errores son estos junto a varias warnings

Код:
C:\Users\Usuario\Desktop\Vortex\gamemodes\Vortex.pwn(42958) : warning 225: unreachable code
C:\Users\Usuario\Desktop\Vortex\gamemodes\Vortex.pwn(43072) : error 017: undefined symbol "siren"
C:\Users\Usuario\Desktop\Vortex\gamemodes\Vortex.pwn(43074) : error 036: empty statement
C:\Users\Usuario\Desktop\Vortex\gamemodes\Vortex.pwn(43077) : error 017: undefined symbol "sendername"
C:\Users\Usuario\Desktop\Vortex\gamemodes\Vortex.pwn(43077) : error 017: undefined symbol "sendername"
C:\Users\Usuario\Desktop\Vortex\gamemodes\Vortex.pwn(43077) : error 029: invalid expression, assumed zero
C:\Users\Usuario\Desktop\Vortex\gamemodes\Vortex.pwn(43077) : fatal error 107: too many error messages on one line
Ayudita pls :c
Reply
#2

Prueba asн;

pawn Код:
CMD:sirena(playerid, params[])
{
    if(Team_Traficante(playerid))
    if(sscanf(params, "s[10]", params[0])) return SendClientMessage(playerid, -1, "/obtener semillas, /obtener crack");
    new Siren[65];
    new VID = GetPlayerVehicleID(playerid);
    if(strcmp(siren, "inside", params[0], true) == 0)
      {
         if(Siren[VID] == 0);
                    {
                        Siren[VID] = 1;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        SirenObject[VID] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
                        AttachObjectToVehicle(SirenObject[VID], VID, 0.0, 0.75, 0.275, 0.0, 0.1, 0.0);
                        format(string, sizeof(string), "* %s pone una sirena atras del volante.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                     else { return SendClientMessage(playerid, COLOR_GREY, "This vehicle already has a siren!");
                }
                }
                else if(strcmp(siren, "roof", params[0], true) == 0)
                {
                    if(Siren[VID] == 0)
                    {
                        Siren[VID] = 1;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        SirenObject[VID] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
                        AttachObjectToVehicle(SirenObject[VID], VID, -0.43, 0.0, 0.785, 0.0, 0.1, 0.0);
                        format(string, sizeof(string), "* %s pone la sirena en el techo del coche.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    } else { return SendClientMessage(playerid, COLOR_GREY, "This vehicle already has a siren!"); }
                }
                else if(strcmp(siren, "off", params[0], true) == 0)
                {
                    if(Siren[VID] == 1)
                    {
                        Siren[VID] = 0;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        DestroyObject(SirenObject[VID]);
                        format(string, sizeof(string), "* %s guarda la sirena.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                   else { return SendClientMessage(playerid, COLOR_GREY, "No puedes ponersela a este coche!"); }
                }
            } else { SendClientMessage(playerid, COLOR_GREY, "   Solo agentes"); }
        }
    return 1;
}
Reply
#3

asi deberia funcionar bien
Код:
CMD:sirena(playerid, params[])
{
    if(Team_Traficante(playerid))
    {
	    new siren[65];
		if(sscanf(params, "s[10]", siren)) return SendClientMessage(playerid, -1, "/obtener semillas, /obtener crack");
	    new VID = GetPlayerVehicleID(playerid);
		if(!strcmp(siren, "inside", true))
	 	{
	    	if(Siren[VID] == 0)
	        {
	        	Siren[VID] = 1;
	        	new sendername[MAX_PLAYER_NAME];
	            GetPlayerName(playerid, sendername, sizeof(sendername));
	            SirenObject[VID] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
	            AttachObjectToVehicle(SirenObject[VID], VID, 0.0, 0.75, 0.275, 0.0, 0.1, 0.0);
	            format(string, sizeof(string), "* %s pone una sirena atras del volante.", sendername);
	            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "This vehicle already has a siren!");
			}
	  	}
	  	else if(!strcmp(siren, "roof", true))
		{
	 		if(Siren[VID] == 0)
	        {
	        	Siren[VID] = 1;
	        	new sendername[MAX_PLAYER_NAME];
	            GetPlayerName(playerid, sendername, sizeof(sendername));
	            SirenObject[VID] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
	            AttachObjectToVehicle(SirenObject[VID], VID, -0.43, 0.0, 0.785, 0.0, 0.1, 0.0);
	            format(string, sizeof(string), "* %s pone la sirena en el techo del coche.", sendername);
	            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
         	}
	 		else
	 		{
			 	SendClientMessage(playerid, COLOR_GREY, "This vehicle already has a siren!");
		 	}
		}
	 	else if(!strcmp(siren, "off", true))
	  	{
	    	if(Siren[VID] == 1)
	        {
	        	Siren[VID] = 0;
	        	new sendername[MAX_PLAYER_NAME];
	            GetPlayerName(playerid, sendername, sizeof(sendername));
	            DestroyObject(SirenObject[VID]);
	            format(string, sizeof(string), "* %s guarda la sirena.", sendername);
	            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	        }
			else
		 	{
			 	SendClientMessage(playerid, COLOR_GREY, "No puedes ponersela a este coche!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_GREY, "Opciуn invбlida, prueba con: inside, roof o off");
		}
    }
	else
	{
		SendClientMessage(playerid, COLOR_GREY, "   Solo agentes");
	}
    return 1;
}
Reply
#4

Si pusieras las lнneas en la que da error serнa mбs fбcil que ver todo ese cуdigo e intentar adivinar que falla.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)