Help! 2 Commands
#1

i have make this 2 commandand look the error i got


Код:
D:\Documents and Settings\Home\Desktop\MaxAdmin\filterscripts\MaxAdmin.pwn(1057) : warning 209: function "dcmd_freeze" should return a value
D:\Documents and Settings\Home\Desktop\MaxAdmin\filterscripts\MaxAdmin.pwn(1058) : error 010: invalid function or declaration
D:\Documents and Settings\Home\Desktop\MaxAdmin\filterscripts\MaxAdmin.pwn(1063) : error 010: invalid function or declaration
D:\Documents and Settings\Home\Desktop\MaxAdmin\filterscripts\MaxAdmin.pwn(1086) : warning 209: function "dcmd_unfreeze" should return a value
D:\Documents and Settings\Home\Desktop\MaxAdmin\filterscripts\MaxAdmin.pwn(1087) : error 010: invalid function or declaration
D:\Documents and Settings\Home\Desktop\MaxAdmin\filterscripts\MaxAdmin.pwn(1092) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Код:
1033.dcmd_freeze(playerid,params[])
1034.{
1035.                new
1036.                Reason[128],
1037.                pID;
1038.                if(Player[playerid][admin] < 1){
1039.                return SendClientMessage (playerid,COLOR_RED,"You Dont Have Right To Use This Command");
1040.                }
1041.                if(sscanf(params,"us",pID,Reason)){
1042.                return SendClientMessage(playerid,COLOR_GREY,"|| Usage: /freeze [playerid] [reason] ||");
1043.                }
1044.                if(!IsPlayerConnected(pID)){
1045.                return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
1046.                }
1047.                new string[128], string3[128], string4[128], adminname[MAX_PLAYER_NAME],name[MAX_PLAYER_NAME];
1048.                GetPlayerName(playerid,adminname,sizeof(adminname));
1049.                GetPlayerName(pID,name,sizeof(name));
1050.                format(string,sizeof(string),"**(ADMIN FREEZE)** %s(%d) %s",name,pID,Reason);
1051.                format(string3,sizeof(string3),"You Have Been FORZEN By Admin For: %s",Reason);
1052.                format(string4,sizeof(string4),"You Have FREEZE %s(%d) For Reason %s",name, pID, Reason);
1053.                SendClientMessageToAll(gold,string);
1054.                SendClientMessage(pID, f,string3);
1055.                SendClientMessage(playerid, COLOR_GREEN,string4);
1056.                TogglePlayerControllable(pID, 0);
1057.        }
1058.        else
1059.        {
1060.                SendClientMessage(playerid,COLOR_ORANGE,"This player is already freezed");
1061.                }
1062.        }
1063.        return 1;
1064.}
Код:
1065.dcmd_unfreeze(playerid,params[])
1066.{
1067.                if(Player[playerid][admin] < 1){
1068.            return SendClientMessage (playerid,COLOR_RED,"You Dont Have Right To Use This Command");
1069.                }
1070.                new pID;
1071.                if(sscanf(params,"u",pID)){
1072.            return SendClientMessage(playerid,COLOR_GREY,"|| Usage: /unfreeze [playerid] ||");
1073.                }
1074.                if(!IsPlayerConnected(pID)){
1075.            return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
1076.                }
1077.                new string[128], string2[128], string3[128], name[MAX_PLAYER_NAME];
1078.                GetPlayerName(pID,name,sizeof(name));
1079.                format(string,sizeof(string),"**(ADMIN UNFREEZE)** %s(%d)",name,pID);
1080.                format(string2,sizeof(string2),"You Have Been UNFORZEN By Admin");
1081.                format(string3,sizeof(string3),"You Have UNFREEZE %s(%d)",name, pID);
1082.                SendClientMessageToAll(gold,string);
1083.                SendClientMessage(pID, f,string2);
1084.                SendClientMessage(playerid, COLOR_GREEN,string3);
1085.                TogglePlayerControllable(pID, 1);
1086.        }
1087.        else
1088.        {
1089.                SendClientMessage(playerid,COLOR_ORANGE,"This player is not freezed");
1090.                }
1091.        }
1092.        return 1;
1093.}
Reply
#2

About the command, with the } else { (last one).
It seems like this:

Quote:

dcmd_freeze(playerid, params[])
{
//THE CODE
}
else
{
//CODE
}

That's NOT good xD - Try rebuilding the command
Reply
#3

the command work if i delete else but its stay freeze not say this play already freezed
Reply
#4

Lol, you put too numbers. You copied from pastebin. Need to remove the number line:
pawn Код:
1090.
1091.
1092.
1093.
And add on OnPlayerCommandText:
pawn Код:
dcmd(freeze,6,cmdtext);
Reply
#5

i copy the number for show you where the errors its not in script
Reply
#6

Hm, then just remove the 2 brackets "}". Also add on OnPlayerCommandText what I said above.
Reply
#7

i do all but i need to make it when player freeze cant freeze again say This player already freezed
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)