Jump to content
  • 0

Problema comanda


crouch010

Question

Salut,deci la comanda /v cand pun doar FIX1 functioneaza si comanda tot,fara erori ,problema vine cand adaug si FIX2 cu "else id"  imi da eroare:

EROARE:

error 017: undefined symbol "x_nr"
Comanda:
if(strcmp(cmd, "/v",true) == 0 || strcmp(cmd, "/vehicle", true) == 0)

		if(IsPlayerConnected(playerid))

	    	if(PlayerInfo[playerid][pPcarkey] != 0)
       	    {
			new x_nr[64];
	        x_nr = strtok(cmdtext, idx);
	        if(!strlen(x_nr))
			{
				SendClientMessage(playerid, COLOR_WHITE, "|______________________Vehicle System__________________|");
				SendClientMessage(playerid, COLOR_WHITE, "| USAGE: /v(ehicle) [name]");
		 		SendClientMessage(playerid, COLOR_GREY, " | Available names: Fix(1-2)");
				SendClientMessage(playerid, COLOR_WHITE, "|______________________________________________________|");
				return 1;
			}
			//GetPlayerName(playerid, sendername, sizeof(sendername));
			//GetPlayerName(giveplayerid, playername, sizeof(playername));
			if(strcmp(x_nr,"fix1",true) == 0)
	        {
	                if(GetPlayerMoney(playerid) > 1000)
				    {
					    if(!IsPlayerInAnyVehicle(playerid))
					    {
			                if(SBizzInfo[8][sbProducts] == 0)
							{
								GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
								return 1;
							}
			                SendClientMessage(playerid, COLOR_GRAD1,"{00C8FF}» {2641FE}PersonalCar 1 was respawned !");
			                SetVehicleToRespawn(PlayerInfo[playerid][pPcarkey]);
							PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
							SBizzInfo[8][sbTill] += 1000;//towcar buisness
							ExtortionSBiz(8, 1000);
							SBizzInfo[8][sbProducts]--;
							GivePlayerMoney(playerid, -1000);
						}
						else GameTextForPlayer(playerid, "~w~Car is~n~in ~r~use", 5000, 1);
					}
					else GameTextForPlayer(playerid, "~r~Not Enough Cash", 5000, 1);
	                return 1;
	                }
	            }
	       else if(strcmp(x_nr,"fix2",true) == 0)

        	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
	            if(GetPlayerMoney(playerid) > 1000)
				    {
				        if(!IsPlayerInAnyVehicle(playerid))
					    {
						    if(SBizzInfo[8][sbProducts] == 0)
							{
								GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
								return 1;
							}
						    SendClientMessage(playerid, COLOR_GRAD1,"{00C8FF}» {2641FE}PersonalCar 2 was respawned !");
						    SetVehicleToRespawn(PlayerInfo[playerid][pPcarkey2]);
							PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
							SBizzInfo[8][sbTill] += 1000;//towcar buisness
							ExtortionSBiz(8, 1000);
							SBizzInfo[8][sbProducts]--;
							GivePlayerMoney(playerid, -1000);
						}
						else GameTextForPlayer(playerid, "~w~Car is~n~in ~r~use", 5000, 1);
					}
					else GameTextForPlayer(playerid, "~r~Not Enough Cash", 5000, 1);
	    			return 1;
					}

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

[pawn]if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0) {

    if(IsPlayerConnected(playerid)) {

        if(PlayerInfo[playerid][pPcarkey] != 0) {

                new x_nr[ 256 ] ;

        x_nr = strtok(cmdtext, idx) ;

        if(!strlen(x_nr))

                // Restul codului.[/pawn]

Si ca raspuns al mesajului privat, nu ofer asistenta prin Team Viewer sau Y!M.

Link to comment
Share on other sites

if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0)
    	if(IsPlayerConnected(playerid))
    		if(PlayerInfo[playerid][pPcarkey] != 0) {
    		new x_nr[ 256 ] ;
	        x_nr = strtok(cmdtext, idx) ;
	        if(!strlen(x_nr))
			{
				SendClientMessage(playerid, COLOR_WHITE, "|______________________Vehicle System__________________|");
				SendClientMessage(playerid, COLOR_WHITE, "| USAGE: /v(ehicle) [name]");
		 		SendClientMessage(playerid, COLOR_GREY, " | Available names: Fix(1-2)");
				SendClientMessage(playerid, COLOR_WHITE, "|______________________________________________________|");
				return 1;
			}
			if(strcmp(x_nr,"fix1",true) == 0)
	        {
	                if(GetPlayerMoney(playerid) > 1000)
				    {
					    if(!IsPlayerInAnyVehicle(playerid))
					    {
			                if(SBizzInfo[8][sbProducts] == 0)
							{
								GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
								return 1;
							}
			                SendClientMessage(playerid, COLOR_GRAD1,"{00C8FF}» {2641FE}PersonalCar 1 was respawned !");
			                SetVehicleToRespawn(PlayerInfo[playerid][pPcarkey]);
							PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
							SBizzInfo[8][sbTill] += 1000;//towcar buisness
							ExtortionSBiz(8, 1000);
							SBizzInfo[8][sbProducts]--;
							GivePlayerMoney(playerid, -1000);
						}
						else GameTextForPlayer(playerid, "~w~Car is~n~in ~r~use", 5000, 1);
					}
					else GameTextForPlayer(playerid, "~r~Not Enough Cash", 5000, 1);
	                }
	            }
	        else if(strcmp(x_nr,"fix2",true) == 0)
       		tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
	            if(GetPlayerMoney(playerid) > 1000)
				    {
				        if(!IsPlayerInAnyVehicle(playerid))
					    {
						    if(SBizzInfo[8][sbProducts] == 0)
							{
								GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
								return 1;
							}
						    SendClientMessage(playerid, COLOR_GRAD1,"{00C8FF}» {2641FE}PersonalCar 2 was respawned !");
						    SetVehicleToRespawn(PlayerInfo[playerid][pPcarkey2]);
							PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
							SBizzInfo[8][sbTill] += 1000;//towcar buisness
							ExtortionSBiz(8, 1000);
							SBizzInfo[8][sbProducts]--;
							GivePlayerMoney(playerid, -1000);
						}
						else GameTextForPlayer(playerid, "~w~Car is~n~in ~r~use", 5000, 1);
					}
					else GameTextForPlayer(playerid, "~r~Not Enough Cash", 5000, 1);
	    	}
ERROR:
else if(strcmp(x_nr,"fix2",true) == 0)

  pe linia asta e eroare....:(( ce are?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.