CMD commands wont work:
#1

Hi guys evertime i translate the commands Zcmd to Dcmd it never works i dont get errors or something!

May you help me with it thanks guys

Код:
dcmd_Work(playerid, params[])
{
    #pragma unused params
	if(!IsPlayerInRangeOfPoint(playerid, 75, 1711.3271,-2411.0510,13.6257)) return SendClientMessage(playerid, COLOR_RED, "You need to be at LAX to begin your flight.");
    if(IsBooked[playerid]) return SendClientMessage(playerid, COLOR_RED, "You are already have a flight in progress.");
	new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsAPlane(vehicleid) ) return Error(playerid, "You need to be an airplane to do air missions");
	loadairmission(playerid);
    return 1;
}
dcmd_cancelwork(playerid, params[])
{
    #pragma unused params
    if(!IsBooked[playerid]) return SendClientMessage(playerid, COLOR_RED, "You are not on a mission.");
    IsBooked[playerid] = 0;
    DisablePlayerCheckpoint(playerid);
    GivePlayerMoney(playerid, -4000);
    SendClientMessage(playerid, COLOR_RED, "You abandoned your flight and have been charged $4,000");
    return 1;
}
Reply
#2

dcmd requires you to have a OnPlayerCommandText callback where you explicitly specify the commands it should COMPARE for.

Now please notice that I used the word "compare" in bold. If you're commencing a move from using zcmd to dcmd, this means you're moving back from trying to execute the command function and evaluating its result to comparing hundreds of strings in major cases.

If you're wondering which method is faster:
1. Call one function. Evaluate its result.
2. Compare 1 to (n) strings where n = amount of commands on your server. Call one function.
... then I can tell you, it is the 1st one.

Unless your script contains 1-5 commands, you should definitely use zcmd for command processing. There's _nothing_ to advocate moving from zcmd to an older processing method.
Reply
#3

maybe i dont wanna translate 500 commands unless someone can help with it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)