05.02.2011, 15:55
Please ive tried everythinng and it still fails :S please someone look at my codes and tell me wat im doing wrong plz?
pawn Код:
CMD:freeze(playerid, params[])
{
if(pInfo[playerid][Level] < 3) return SendClientMessage(playerid,RED,">> You Must Be Level 3+ To Use This Command!");
new target;
new string[256], playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME];
if(sscanf(params, "uc", playername, params)) return SendClientMessage(playerid,RED,"USAGE: /freeze [id] [reason]");
target = MAX_PLAYER_NAME;
if(IsPlayerConnected(target) && target != INVALID_PLAYER_ID) return SendClientMessage(playerid,RED,">> Invalid Player ID!");
GetPlayerName(target, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
TogglePlayerControllable(target,1);
SendClientMessage(target,RED, ">> You Have Been Frozen By An Admin!");
GameTextForPlayer(target,"~r~Frozen!",3000,5);
format(string,sizeof(string),">> Administrator %s Has Frozen %s! Reason: %s",adminname,playername,string);
return SendClientMessageToAll(RED,string);
}
CMD:unfreeze(playerid, params[])
{
if(pInfo[playerid][Level] < 3) return SendClientMessage(playerid,RED,">> You Must Be Level 3+ To Use This Command!");
new target;
new string[256], playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME];
if(sscanf(params, "u", playername)) return SendClientMessage(playerid,RED,"USAGE: /unfreeze [id]");
target = MAX_PLAYER_NAME;
if(IsPlayerConnected(target) && target != INVALID_PLAYER_ID) return SendClientMessage(playerid,RED,">> Invalid Player ID!");
GetPlayerName(target, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
TogglePlayerControllable(target,1);
SendClientMessage(target,YELLOW, ">> You Have Been Unfrozen By An Admin!");
GameTextForPlayer(target,"~g~Unfrozen!",3000,5);
format(string,sizeof(string),">> Administrator %s Has UnFrozen %s! Reason: %s",adminname,playername,string);
return SendClientMessageToAll(RED,string);
}
CMD:mute(playerid, params[])
{
if(pInfo[playerid][Level] < 3) return SendClientMessage(playerid,RED,">> You Must Be Level 3+ To Use This Command!");
new muteid;
if(!strlen(params)) return SendClientMessage(playerid,RED,"USAGE: /mute [id]");
{
if (muteid == INVALID_PLAYER_ID) return SendClientMessage(playerid,RED, ">> Player Not Found!");
{
if(muteid == playerid) return SendClientMessage(playerid,RED, ">> You Cant Unmute Yourself!");
{
IsMuted[muteid] = 1;
SendClientMessage(muteid,RED, ">> You Have Been Muted By An Admin!");
GameTextForPlayer(muteid,"~r~Muted!",3000,5);
}
}
}
return true;
}
CMD:unmute(playerid, params[])
{
if(pInfo[playerid][Level] < 3) return SendClientMessage(playerid,RED,">> You Must Be Level 3+ To Use This Command!");
new muteid;
if(!strlen(params)) return SendClientMessage(playerid,RED,"USAGE: /unmute [id]");
{
if (muteid == INVALID_PLAYER_ID) return SendClientMessage(playerid,RED, ">> Player Not Found!");
{
if(muteid == playerid) return SendClientMessage(playerid,RED, ">> You Cant Unmute Yourself!");
{
IsMuted[muteid] = 0;
SendClientMessage(muteid,YELLOW, ">> You Have Been Unmuted By An Admin!");
GameTextForPlayer(muteid,"~g~Unmuted!",3000,5);
}
}
}
return true;
}