strcmp to zcmd help!
#1

how would i translate this to strcmp to zcmd can you gimma a little help i only know much about zcmd more then strcmp Thanks guys


Код:
if(strcmp("/gfix", cmdtext, true) == 0 || strcmp(cmdtext, "/garagefix", true) == 0)
Reply
#2

pawn Код:
CMD:gfix(playerid, params[])
{
       return cmd_garagefix(playerid, params);
}
I'm not sure if that's what you're trying to do. But he explaisn it on his thread, which can be found at this link. https://sampforum.blast.hk/showthread.php?tid=91354
Reply
#3

yea man thanks mate


EDIT: my full code here

Код:
if(strcmp("/gfix", cmdtext, true) == 0 || strcmp(cmdtext, "/garagefix", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	    	if(GetPVarInt(playerid, "InGarage") != 0)
			{
	    	    GetPlayerName(playerid, sendername, sizeof(sendername));
        		new Float:vehx, Float:vehy, Float:vehz;
				for(new v = 0; v<MAX_VEHICLES; v++)
				{
	    			GetVehiclePos(v, vehx, vehy, vehz);
    				if(IsPlayerInRangeOfPoint(playerid, 3.0, vehx, vehy, vehz))
    				{
						if (IsACar(v))
						{
							if(HoodOpen[v] == 1)
							{
								RepairVehicle(v);
		        				PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
								if(PlayerInfo[playerid][pMask] == 1)
								{
						    		format(string, sizeof(string), "* Stranger has repaired the vehicle.");
								}
								else
								{
							    	format(string, sizeof(string), "* %s has repaired the vehicle.", sendername);
								}
		        				ProxDetector(30.0, playerid, string,PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);

		        				new light;
							    GetVehicleParamsEx(v, engine, light, alarm, doors, bonnet, boot, objective);
							    SetVehicleParamsEx(v, engine, light, alarm, doors, VEHICLE_PARAMS_ON, boot, objective);
		        				return 1;
	   						}
	   						else
	   						{
	   						    SendClientMessage(playerid,GREY, "The hood is not opened.");
	   						    return 1;
						    }
						}
						else
						{
						    RepairVehicle(v);
		        			PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
							if(PlayerInfo[playerid][pMask] == 1)
							{
						   		format(string, sizeof(string), "* Stranger has repaired the vehicle.");
							}
							else
							{
						    	format(string, sizeof(string), "* %s has repaired the vehicle.", sendername);
							}
		        			ProxDetector(30.0, playerid, string,PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
		        			return 1;
						}
			    	}
	    	    }
	    	}
	    	else
	    	{
	    	    SendClientMessage(playerid, GREY, "    You are not inside a garage.");
	    	}
		}
		return 1;
	}
Reply
#4

The code itself shouldn't matter, do what Ranger said and you should be good.
Reply
#5

If the code works, then all you need to do is return the current command in another, as I showed you. If it doesn't work, then that's a whole different story.
Reply
#6

alright man thanks again guys
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)