can someone convert this for me please from Zcmd to Strcmp
#1

i need these commands converted to strcmp format please, rep will be given to the first person to do so
Код:
CMD:hitch(playerid, params[])
{
    if  (IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) SendClientMessage(playerid, COLOR_GREY, "You are already towing a Trailer/Vehicle.");
    new Float:PPPX,Float:PPPY,Float:PPPZ;
    GetPlayerPos(playerid,PPPX,PPPY,PPPZ);
    new Float:VVVX,Float:VVVY,Float:VVVZ;
    new Found=0;
    new vid=0;
    while((vid<MAX_VEHICLES)&&(!Found))
    {
    	vid++;
        GetVehiclePos(vid,VVVX,VVVY,VVVZ);
        if  ((floatabs(PPPX-VVVX)<7.0)&&(floatabs(PPPY-VVVY)<7.0)&&(floatabs(PPPZ-VVVZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
        {
        	Found=1;
            AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
        }

    }
    if  (!Found)
    {
		SendClientMessage(playerid,COLOR_GREY,"There is no vehicle in range.");
    }
    return 1;
}

CMD:unhitch(playerid, params[])
{
	#pragma unused params

	new veh = GetPlayerVehicleID(playerid);

	if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD2, "You must be in a vehicle to do this.");
	if(!IsTrailerAttachedToVehicle(veh)) return SendClientMessageEx(playerid, COLOR_GRAD2, "You do not have a trailer attached to your vehicle.");

	DetachTrailerFromVehicle(veh);
	SendClientMessageEx(playerid, COLOR_GRAD2, "Your trailer has been detached from your vehicle.");

	return 1;
}
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/hitch", cmdtext, true, 10) == 0)
    {
    if  (IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) SendClientMessage(playerid, COLOR_GREY, "You are already towing a Trailer/Vehicle.");
    new Float:PPPX,Float:PPPY,Float:PPPZ;
    GetPlayerPos(playerid,PPPX,PPPY,PPPZ);
    new Float:VVVX,Float:VVVY,Float:VVVZ;
    new Found=0;
    new vid=0;
    while((vid<MAX_VEHICLES)&&(!Found))
    {
        vid++;
        GetVehiclePos(vid,VVVX,VVVY,VVVZ);
        if  ((floatabs(PPPX-VVVX)<7.0)&&(floatabs(PPPY-VVVY)<7.0)&&(floatabs(PPPZ-VVVZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
        {
            Found=1;
            AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
        }
    }
    if  (!Found)
    {
        SendClientMessage(playerid,COLOR_GREY,"There is no vehicle in range.");
    }
    return 1;
    }
    if (strcmp("/unhitch", cmdtext, true, 10) == 0)
    {
    new veh = GetPlayerVehicleID(playerid);

    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD2, "You must be in a vehicle to do this.");
    if(!IsTrailerAttachedToVehicle(veh)) return SendClientMessageEx(playerid, COLOR_GRAD2, "You do not have a trailer attached to your vehicle.");

    DetachTrailerFromVehicle(veh);
    SendClientMessageEx(playerid, COLOR_GRAD2, "Your trailer has been detached from your vehicle.");
        return 1;
    }
    return 0;
}
Reply
#3

thanks , just repped you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)