Possible Zcmd? -
Tuntun - 02.02.2013
Hello
I have a gamemode and its not created by Zcmd its a_samp...
So my question is "Can i use ZCMD"?
Re: Possible Zcmd? -
Roach_ - 02.02.2013
Yes, but you must convert all the commands...
Re: Possible Zcmd? -
Goldino - 02.02.2013
Give me all your OnPlayerCommandText callback
Re: Possible Zcmd? -
Tuntun - 03.02.2013
Here it is:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/mhill", true) == 0){
if(IsPlayerInAnyVehicle(playerid) == 1) {
SetPlayerInterior(playerid, 0);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
SetVehiclePos(GetPlayerVehicleID(playerid),-2489.6118,-615.7424,132.1036);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 310.2000);
LinkVehicleToInterior(GetPlayerVehicleID(playerid) , 0);
} else {
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid,-2538.4004,-612.1431,132.7109);
SetPlayerFacingAngle(playerid, 270.0);
SetCameraBehindPlayer(playerid);
}
} else {
SetPlayerPos(playerid,-2538.4004,-612.1431,132.7109);
SetPlayerFacingAngle(playerid, 270.0);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
}
return 1;
}
Re: Possible Zcmd? -
Tuntun - 04.02.2013
Hello,Help me please?
Re: Possible Zcmd? -
Lordzy - 07.02.2013
pawn Код:
CMD:mhill
{
if(IsPlayerInAnyVehicle(playerid) == 1) {
SetPlayerInterior(playerid, 0);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
SetVehiclePos(GetPlayerVehicleID(playerid),-2489.6118,-615.7424,132.1036);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 310.2000);
LinkVehicleToInterior(GetPlayerVehicleID(playerid) , 0);
} else {
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid,-2538.4004,-612.1431,132.7109);
SetPlayerFacingAngle(playerid, 270.0);
SetCameraBehindPlayer(playerid);
}
} else {
SetPlayerPos(playerid,-2538.4004,-612.1431,132.7109);
SetPlayerFacingAngle(playerid, 270.0);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
}
return 1;
}
It's easy to make commands with zcmd. For example, if you create a command (/healme) - here's the way of normal OnPlayerCommandText:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/healme", true) == 0)
{
SetPlayerHealth(playerid, 100.00);
return 1;
}
return 0;
}
Where as in zcmd, it gets more easier and is more efficient.
CMD:healme(playerid, params[])
{
SetPlayerHealth(playerid, 100.00);
return 1;
}
[/PAWN]
Zcmd commanding:
pawn Код:
CMD:yourcommand(playerid, params[]) //playerid refers to the player using the cmd. params refers to the string parameter of the command.
{
//Here functions
return 1; //Returning the command.
}