can someone convert this for me please from Zcmd to Strcmp - 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: can someone convert this for me please from Zcmd to Strcmp (
/showthread.php?tid=437746)
can someone convert this for me please from Zcmd to Strcmp -
Crossfire1989 - 17.05.2013
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;
}
Re: can someone convert this for me please from Zcmd to Strcmp -
Guest123 - 17.05.2013
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;
}
Re: can someone convert this for me please from Zcmd to Strcmp -
Crossfire1989 - 17.05.2013
thanks

, just repped you