disable /fix command in certain area. - 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: disable /fix command in certain area. (
/showthread.php?tid=283109)
disable /fix command in certain area. -
Gemini - 13.09.2011
Here is my /fix command, its dcmd. How can I disable it in for example a DM zone?
PHP код:
dcmd_fix(playerid, params[])
{
#pragma unused params
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are not in a vehicle!");
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_WHITE, "Your vehicle has been successfully repaired!");
return 1;
}
Re: disable /fix command in certain area. -
Wesley221 - 13.09.2011
Add 'IsPlayerInDM[MAX_PLAYERS]; on top. Then whena player joins a DM match, use Isplayerindm[playerid] = 1;
When he dies or leaves, then change it back to 0.
And add this to every command:
pawn Код:
if( IsPlayerInDM[playerid] == 1) return SendClientmessage(-----);
Re: disable /fix command in certain area. -
=WoR=Varth - 13.09.2011
Or
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Re: disable /fix command in certain area. -
Gemini - 13.09.2011
Doesnt work :S
Re: disable /fix command in certain area. -
Gemini - 13.09.2011
PHP код:
dcmd_fix(playerid, params[])
{
#pragma unused params
if(IsPlayerInDM[playerid] = 0);
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are not in a vehicle!");
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_WHITE, "Your vehicle has been successfully repaired!");
return 1;
}
}
errors:
: warning 211: possibly unintended assignment
: error 036: empty statement
Re: disable /fix command in certain area. -
[MWR]Blood - 13.09.2011
pawn Код:
dcmd_fix(playerid, params[])
{
#pragma unused params
if(IsPlayerInDM[playerid] = 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are not in a vehicle!");
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_WHITE, "Your vehicle has been successfully repaired!");
return 1;
}
}
Re: disable /fix command in certain area. -
Marricio - 13.09.2011
pawn Код:
new IsAtDM[MAX_PLAYERS]; // at the top of script.
IsAtDM[playerid] = 1; // the command or function when players get in the DM zone
dcmd_fix(playerid, params[])
{
#pragma unused params
if(IsAtDM[playerid] == 1) return SendClientMessage(playerid, COLOR_WHITE, "Cant use in a DM zone!");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are not in a vehicle!");
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_WHITE, "Your vehicle has been successfully repaired!");
return 1;
}
Aint that hard bro.