CMD:dive(playerid, params[]) { new highness; if(sscanf(params,"i",highness))return SendClientMessage(playerid,COLOR_GREEN,"/dive [high 100-800]"); if (highness < 100 || highness > 800) return SendClientMessage(playerid,COLOR_GREEN,"/dive [high 100-800]");//COLOR_BROWN SendClientMessage(playerid,COLOR_RED,"You dive. Enjoy."); new Float:x,Float:y,Float:z; GetPlayerPos(playerid,x,y,z); SetPlayerPos(playerid,x,y,z+highness); GivePlayerWeapon(playerid, 46, 1); SendAdminCMD(playerid, "dive"); return 1; }
new
Cooldown[MAX_PLAYERS char];
CMD:dive(playerid, params[]) {
if(Cooldown{playerid} > gettime())
return SendClientMessage(playerid, COLOR_GREEN, "You already dived!");
new highness;
if(sscanf(params,"i",highness))return SendClientMessage(playerid,COLOR_GREEN,"/dive [high 100-800]");
if (highness < 100 || highness > 800) return SendClientMessage(playerid,COLOR_GREEN,"/dive [high 100-800]");//COLOR_BROWN
SendClientMessage(playerid,COLOR_RED,"You dive. Enjoy.");
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(playerid,x,y,z+highness);
GivePlayerWeapon(playerid, 46, 1);
SendAdminCMD(playerid, "dive");
Cooldown{playerid} = gettime() + 60;
return 1;
}
CMD:dive(playerid, params[])
{
new highness;
if(sscanf(params,"i",highness))return SendClientMessage(playerid,COLOR_GREEN,"/dive [high 100-800]");
if (highness < 100 || highness > 800) return SendClientMessage(playerid,COLOR_GREEN,"/dive [high 100-800]");//COLOR_BROWN
SendClientMessage(playerid,COLOR_RED,"You dive. Enjoy.");
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(playerid,x,y,z+highness);
GivePlayerWeapon(playerid, 46, 1);
SendAdminCMD(playerid, "dive");
if(GetPVarInt(playerid,"pMIN") > GetTickCount()) return SendClientMessage(playerid, COLOR_GREEN,"You have to wait 1 minutes to use the command again");
SetPVarInt(playerid,"pMIN",GetTickCount()+60000); // Minute
return 1;
}
new Cmd[MAX_PLAYERS]; CMD:dive(playerid, params[]) { if(Cmd[playerid] > gettime())return SendClientMessage(playerid,COLOR_GREEN,"You should wait 1 minute to use this cmd again;"); new highness; if(sscanf(params,"i",highness))return SendClientMessage(playerid,COLOR_GREEN,"/dive [high 100-800]"); if (highness < 100 || highness > 800) return SendClientMessage(playerid,COLOR_GREEN,"/dive [high 100-800]");//COLOR_BROWN SendClientMessage(playerid,COLOR_RED,"You dive. Enjoy."); new Float:x,Float:y,Float:z; GetPlayerPos(playerid,x,y,z); SetPlayerPos(playerid,x,y,z+highness); GivePlayerWeapon(playerid, 46, 1); Cmd[playerid] = gettime() + 60; SendAdminCMD(playerid, "dive"); return 1; }
Код:
new Cmd[MAX_PLAYERS]; CMD:dive(playerid, params[]) { if(Cmd[playerid] > gettime())return SendClientMessage(playerid,COLOR_GREEN,"You should wait 1 minute to use this cmd again;"); new highness; if(sscanf(params,"i",highness))return SendClientMessage(playerid,COLOR_GREEN,"/dive [high 100-800]"); if (highness < 100 || highness > 800) return SendClientMessage(playerid,COLOR_GREEN,"/dive [high 100-800]");//COLOR_BROWN SendClientMessage(playerid,COLOR_RED,"You dive. Enjoy."); new Float:x,Float:y,Float:z; GetPlayerPos(playerid,x,y,z); SetPlayerPos(playerid,x,y,z+highness); GivePlayerWeapon(playerid, 46, 1); Cmd[playerid] = gettime() + 60; SendAdminCMD(playerid, "dive"); return 1; } test it u can use that cmd once per minute. |
Jamester , Oma both of your codes didnt work for :/ but thank you for the help +rep
|