Need Help Please Help!
#1

this command is all work not errors what i need to add something for exampel

/freeze 1 dm

now he got freeze

Admin blalba freezed balblala for Reason: dm

now i need when i freeze the same id while he is freezed tell

balba is already freezed

please help guys!


Код:
dcmd_freeze(playerid,params[]){
		new
 		Reason[128],
  		pID;
		if(Player[playerid][admin] < 1){
 		 	return 0;
		}
		if(sscanf(params,"us",pID,Reason)){
 		return SendClientMessage(playerid,COLOR_GREY,"|| Usage: /freeze [playerid] [reason] ||");
		}
		if(!IsPlayerConnected(pID)){
 		return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
		}
		if(pID == playerid){
			return SendClientMessage(playerid,COLOR_RED,"You can`t FREEZE yourself");
		}
		if(Player[playerid][admin] < Player[pID][admin]){
			return SendClientMessage(playerid,COLOR_RED,"You can`t FREEZE a high ranked admin");
		}
		new string[128], string3[128], string4[128], str[128], name[MAX_PLAYER_NAME], aname[MAX_PLAYER_NAME];
		GetPlayerName(pID,name,sizeof(name));
		GetPlayerName(playerid, aname, sizeof(aname));
		format(string,sizeof(string),"**(ADMIN FREEZE)** %s(%d) %s",name,pID,Reason);
		format(string3,sizeof(string3),"You Have Been FORZEN By Admin For: %s",Reason);
		format(string4,sizeof(string4),"You Have FREEZE %s(%d) For Reason %s",name, pID, Reason);
		format(str,sizeof(str), "Admin %s(%d) Has FREEZED %s(%d) For Reason: %s",aname,playerid,name,pID,Reason);
		SendClientMessageToAll(gold,string);
		SendClientMessage(pID, f,string3);
		SendClientMessage(playerid, COLOR_GREEN,string4);
		SendAdminMessage(COLOR_YELLOW, str);
		TogglePlayerControllable(pID, 0);
		SaveToFile("Freeze", str);
		return 1;
}
Reply
#2

Under inc's:
pawn Код:
new Frozen [ MAX_PLAYERS ];
Freeze Command:
pawn Код:
dcmd_freeze(playerid,params[])
{
    new Reason[66], pID;
    if(Player[playerid][admin] < 1) return 0;
    if(sscanf(params,"us[65]",pID,Reason)) return SendClientMessage(playerid,COLOR_GREY,"|| Usage: /freeze [playerid] [reason] ||");
    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
    if(pID == playerid) return SendClientMessage(playerid,COLOR_RED,"You can`t FREEZE yourself");
    if(Player[playerid][admin] < Player[pID][admin]) return SendClientMessage(playerid,COLOR_RED,"You can`t FREEZE a high ranked admin");
    if(Frozen[pID] == 1) return SendClientMessage(playerid,COLOR_RED,"Error: player is already frozen.");
    new string[128], string3[128], string4[128], str[128], name[MAX_PLAYER_NAME], aname[MAX_PLAYER_NAME];
    GetPlayerName(pID,name,sizeof(name));
    GetPlayerName(playerid, aname, sizeof(aname));
    format(string,sizeof(string),"**(ADMIN FREEZE)** %s(%d) %s",name,pID,Reason);
    format(string3,sizeof(string3),"You Have Been FROZEN By Admin For: %s",Reason);
    format(string4,sizeof(string4),"You Have FREEZE %s(%d) For Reason %s",name, pID, Reason);
    format(str,sizeof(str), "Admin %s(%d) Has FREEZED %s(%d) For Reason: %s",aname,playerid,name,pID,Reason);
    SendClientMessageToAll(gold,string);
    SendClientMessage(pID, f,string3);
    SendClientMessage(playerid, COLOR_GREEN,string4);
    SendAdminMessage(COLOR_YELLOW, str);
    TogglePlayerControllable(pID, 0);
    Frozen[pID] = 1;
    SaveToFile("Freeze", str);
    return 1;
}
UnFreeze Command:
pawn Код:
dcmd_unfreeze(playerid,params[])
{
    new Reason[128], pID;
    if(Player[playerid][admin] < 1) return 0;
    if(sscanf(params,"us",pID,Reason)) return SendClientMessage(playerid,COLOR_GREY,"|| Usage: /unfreeze [playerid]||");
    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
    if(pID == playerid) return SendClientMessage(playerid,COLOR_RED,"You can`t FREEZE yourself");
    if(Player[playerid][admin] < Player[pID][admin]) return SendClientMessage(playerid,COLOR_RED,"You can`t FREEZE a high ranked admin");
    if(Frozen[pID] == 0) return SendClientMessage(playerid,COLOR_RED,"Error: player is not frozen.");
    new string[128], string3[128], string4[128], str[128], name[MAX_PLAYER_NAME], aname[MAX_PLAYER_NAME];
    GetPlayerName(pID,name,sizeof(name));
    GetPlayerName(playerid, aname, sizeof(aname));
    format(string,sizeof(string),"**(ADMIN UnFrozen)** %s(%d)",name,pID);
    SendClientMessageToAll(gold,string);
    SendClientMessage(pID, f,"You Have Been UnFrozen By Admin");
    format(string4,sizeof(string4),"You Have UnFrozen %s(%d)",name, pID);
    SendClientMessage(playerid, COLOR_GREEN,string4);
    format(str,sizeof(str), "Admin %s(%d) Has UnFrozen %s(%d)",aname,playerid,name,pID);
    SendAdminMessage(COLOR_YELLOW, str);
    TogglePlayerControllable(pID, 1);
    Frozen[pID] = 0;
    SaveToFile("Freeze", str);
    return 1;
}
OnPlayerConnect or OnPlayerDisconnect:
pawn Код:
Frozen[playerid] = 0;
Edit: Next time try this: https://sampforum.blast.hk/showthread.php?tid=187229
Reply
#3

Thank you bro good luck!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)