How to call?
#1

How to call a command using pawncmd?
Reply
#2

Quote:
Originally Posted by Osamakurdi
Посмотреть сообщение
How to call a command using pawncmd?
https://sampforum.blast.hk/showthread.php?tid=608474
Reply
#3

Quote:
Originally Posted by ForCop
Посмотреть сообщение
I didn't understand .
CODE:
Код:
CMD:engine(playerid, params[])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "ERROR:You must be in a car.");
    new vehicleid, engine, lights, alarm, doors, bonnet, boot, objective;
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    if(engineo[vehicleid] == true)
    {
        return SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective),
        engineo[vehicleid] = false,
		GameTextForPlayer(playerid, "~n~~n~Engine~r~~h~Off", 2000, 4);
        //SendClientMessage(playerid, COLOR_RED, "Engine succesfully stoped.");
    }
    if(engineo[vehicleid] == false)
    {
        return SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective),
        engineo[vehicleid] = true,
		GameTextForPlayer(playerid, "~n~~n~Engine~g~~h~On", 2000, 4);
        //SendClientMessage(playerid, COLOR_YELLOW, "Engine succesfully starts.");
    }
    return 1;
}
something like this ?
Код:
if (GetPlayerVehicleSeat(playerid) == 0)
    {
        if (newkeys & KEY_SUBMISSION) 
        {
               return CallLocalFunction( "cmd_engine", "i", playerid);
       	}

    }
Reply
#4

Fixed with these changings:
Код:
    if (GetPlayerVehicleSeat(playerid) == 0)
    {
        if (newkeys & KEY_SUBMISSION) 
        {
               return  PC_EmulateCommand(playerid, "/engine");
       	}

    }
Reply
#5

call the command
PHP код:
callcmd::engine(playeridparams[]); 
or you can emulate the command
PHP код:
PC_EmulateCommand(playerid"/engine"); 
Reply
#6

Quote:
Originally Posted by rfr
Посмотреть сообщение
call the command
PHP код:
callcmd::engine(playeridparams[]); 
or you can emulate the command
PHP код:
PC_EmulateCommand(playerid"/engine"); 
Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)