Nothing happens when i type CMD! (+rep)
#1

This CMD

Nothing happens when i type that cmd! even this

Код:
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setadminname [playerid/partofname] [name]");
That code doesnt appear.. PLEASE HELP ME!

Код:
CMD:setadminname(playerid, params[])
{
	if(IsPlayerConnected(playerid)) return 1;
	if(PlayerInfo[playerid][pAdmin] > 99998)
	{
		/*if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
	    {
	        SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
			return 1;
	    }*/

		new giveplayerid, name[32];
		if(sscanf(params, "us[32]", giveplayerid, name))
		{
            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setadminname [playerid/partofname] [name]");
            return 1;
		}

		if(PlayerInfo[giveplayerid][pAdmin] < 1)
		{
		    SendClientMessage(playerid, COLOR_WHITE, "The player is not an admin.");
		    return 1;
		}

		if(PlayerInfo[giveplayerid][pAdminDuty] != 0)
		{
		    SendClientMessage(playerid, COLOR_WHITE, "That admin is currently on-duty. They must go off-duty in order for you to set their admin name.");
		    return 1;
		}

		new length = strlen(name);
		if(length < 3 || length > 20)
		{
		    SendClientMessage(playerid, COLOR_WHITE, "The name can't less than 3 characters or more than 20 characters.");
		    return 1;
		}

		if(strfind(name, "_", true) != -1)
		{
		    SendClientMessage(playerid, COLOR_WHITE, "The admin name must be one name. There can't be an underscore in the name.");
		    return 1;
		}

		if(strcmp(name, "Zhao", true) == 0 && PlayerInfo[playerid][pAdmin] < 6) {
		    SendClientMessage(playerid, COLOR_WHITE, "stop ! im zao ! you're not zao !");
			return 1;
		}

		new string[128];
		new str[128];
		format(str, sizeof(str), "Adminstrator %s has setted your admin name to '%s' you may now go /aduty", GetPlayerNameEx(playerid), name);
		format(string, sizeof(string), "AdmCmd: %s has set %s's admin name to '%s'.", GetPlayerNameEx(playerid),  GetPlayerNameEx(giveplayerid), name);
		ABroadCast(COLOR_LIGHTRED, string, 1);
		SendClientMessage(giveplayerid, COLOR_WHITE, str);
		PlayerInfo[giveplayerid][pAdminNameSet] = 1;

        format(PlayerInfo[giveplayerid][pAdminName], 32, name);
	}
	else SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
	return 1;
}
Reply
#2

#1 your script is stolen from H:RP

pawn Код:
SendClientMessage(playerid, COLOR_WHITE, "stop ! im zao ! you're not zao !");
#2 Stop posting on the forums for EVERY thing you have wrong.
a) Search ******
b) Search SA-MP Forums
c) Evaluated the code and try to fix it yourself before posting 20 threads.
Reply
#3

[QUOTE=Ari;2985042]#1 your script is stolen from H:RP

pawn Код:
SendClientMessage(playerid, COLOR_WHITE, "stop ! im zao ! you're not zao !");

What da hell ?? HZRP script?

Its came from my friend he send me that

I dont use that stupid HZRP script anymroe
Reply
#4

Just remove the line that contains: if(IsPlayerConnected(playerid)) return 1;. And your ready to go.
Reply
#5

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Just remove the line that contains: if(IsPlayerConnected(playerid)) return 1;. And your ready to go.
i already know



This guy tells me
Reply
#6

Okay, problem solved then :P
Reply
#7

pawn Код:
CMD:setadminname(playerid, params[])
{
    new iTargetID, iTargetName[MAX_PLAYER_NAME], szName[MAX_PLAYER_NAME], szString[128];
    if(sscanf(params, "is", iTargetID, szName)) SendClientMessage(playerid, COL_GREY, "USAGE: /setadminname [ID] [NAME]");
   
   
    if(!IsPlayerConnected(iTargetID)) {
        new string[128];
        format(string, sizeof(string), "WARN: Player ID: %i isn't connected!", iTargetID);
        SendClientMessage(playerid, COL_GREY, string);
    }
    GetPlayerName(iTargetID, iTargetName, sizeof(iTargetName));
   
    if(PlayerInfo[playerid][pAdmin] < 99998) return SendClientMessage(playerid, COL_GREY, "ERR: You cannot use this command!"):
    if(PlayerInfo[iTargetID][pAdmin] < 1) return SendClientMessage(playerid, COL_GREY, "ERR: %s isn't an admin!", iTargetName);
    if(PlayerInfo[iTargetID][pAdminDuty] > 0) return SendClientMessage(playerid, COL_GREY, "ERR: %s's name cannot be set because they're currently on-duty!");
    if(strlen(szName) < 3 || > 32) return SendClientMessage(playerid, COL_GREY, "ERR: Input must be more than 3 and less than 32!");
   
    format(szString, sizeof(szString), "SRV: Administrator %s has set your administrator name to ""%s.""", GetPlayerNameEx(playerid), szName);
    SendClientMessage(iTargetID, COLOR_WHITE, str);
   
    format(szString, sizeof(szString), "SRV: %s has set %s's administrator name to '%s'", GetPlayerNameEx(playerid), iTargetName, szName);
    ABroadCast(COLOR_LIGHTRED, szString, 1);
    return 1;
}
That WAS HZ:RP script, it references Zhao.
Reply
#8

Quote:
Originally Posted by Ari
Посмотреть сообщение
pawn Код:
CMD:setadminname(playerid, params[])
{
    new iTargetID, iTargetName[MAX_PLAYER_NAME], szName[MAX_PLAYER_NAME], szString[128];
    if(sscanf(params, "is", iTargetID, szName)) SendClientMessage(playerid, COL_GREY, "USAGE: /setadminname [ID] [NAME]");
   
   
    if(!IsPlayerConnected(iTargetID)) {
        new string[128];
        format(string, sizeof(string), "WARN: Player ID: %i isn't connected!", iTargetID);
        SendClientMessage(playerid, COL_GREY, string);
    }
    GetPlayerName(iTargetID, iTargetName, sizeof(iTargetName));
   
    if(PlayerInfo[playerid][pAdmin] < 99998) return SendClientMessage(playerid, COL_GREY, "ERR: You cannot use this command!"):
    if(PlayerInfo[iTargetID][pAdmin] < 1) return SendClientMessage(playerid, COL_GREY, "ERR: %s isn't an admin!", iTargetName);
    if(PlayerInfo[iTargetID][pAdminDuty] > 0) return SendClientMessage(playerid, COL_GREY, "ERR: %s's name cannot be set because they're currently on-duty!");
    if(strlen(szName) < 3 || > 32) return SendClientMessage(playerid, COL_GREY, "ERR: Input must be more than 3 and less than 32!");
   
    format(szString, sizeof(szString), "SRV: Administrator %s has set your administrator name to ""%s.""", GetPlayerNameEx(playerid), szName);
    SendClientMessage(iTargetID, COLOR_WHITE, str);
   
    format(szString, sizeof(szString), "SRV: %s has set %s's administrator name to '%s'", GetPlayerNameEx(playerid), iTargetName, szName);
    ABroadCast(COLOR_LIGHTRED, szString, 1);
    return 1;
}
That WAS HZ:RP script, it references Zhao.
ok i will tell my friend stop sending codes copied from H:ZRP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)