Is there a way to make this work for zcmd - 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: Is there a way to make this work for zcmd (
/showthread.php?tid=366761)
Is there a way to make this work for zcmd -
Michael_Cuellar - 07.08.2012
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[]) {
if (!strcmp("/refuel",cmdtext,true,7)) {
if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFC800FF,"You are not in an vehicle!");
if (isrefuelling[playerid]) return SendClientMessage(playerid,0xFFC800FF,"You are already refuelling!");
if (GetPlayerMoney(playerid) - 80 <0) return SendClientMessage(playerid,0xFFC800FF,"You dont have enough money!");
GivePlayerMoney(playerid,-80);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,0);
isrefuelling[playerid] = 1;
TextDrawSetString(td_fuel[playerid],"Refuelling...");
SetTimerEx("timer_refuel",4500,false,"i",playerid);
return 1;
}
return 0;
}
Re: Is there a way to make this work for zcmd -
FalconX - 07.08.2012
pawn Код:
CMD:refuel( playerid, params[ ] )
{
if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFC800FF,"You are not in an vehicle!");
if (isrefuelling[playerid]) return SendClientMessage(playerid,0xFFC800FF,"You are already refuelling!");
if (GetPlayerMoney(playerid) - 80 <0) return SendClientMessage(playerid,0xFFC800FF,"You dont have enough money!");
GivePlayerMoney(playerid,-80);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,0);
isrefuelling[playerid] = 1;
TextDrawSetString(td_fuel[playerid],"Refuelling...");
SetTimerEx("timer_refuel",4500,false,"i",playerid);
return 1;
}
Hope this helps.
Edit: Don't forget to remove strcmp commands and the best is to remove the whole OnPlayerCommandText public callback.
Regards,
FalconX
Re: Is there a way to make this work for zcmd -
Michael_Cuellar - 07.08.2012
thanks +rep
Re: Is there a way to make this work for zcmd -
FalconX - 07.08.2012
Quote:
Originally Posted by Michael_Cuellar
thanks +rep
|
No problem mate, if you have any kind of help just give me a call
Regards,
FalconX