CMD Does not working
#1

CMD Does not working here is the CMD

pawn Код:
CMD:sethours(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 5)
    {
        new targetid, hours, string[150];
        if(sscanf(params, "ud", targetid, hours)) return SendClientMessage(playerid, -1, "{FF8C00}[USAGE] {FFFFFF}/sethours [playerid] [hours]");
        PlayerInfo[targetid][pHours] = hours;
        format(string, sizeof(string), "{FF8C00}[INFO] {FFFFFF}You edited %s's hours to %d.", targetid, hours);
        SendClientMessage(playerid, -1, string);
        SendClientMessage(targetid, -1, "{FF8C00}[INFO] {FFFFFF}Your hours were edited. Check your /stats.");
        return 1;
    }
    else return SendClientMessage(playerid, -1, "{FF0000}[ERROR] {FFFFFF}You are unauthorized to use this command.");
}
Reply
#2

Whats the problem with it you dont get any errors while compling or you it doesnt work at all
explain more please
Reply
#3

If it gives you error use this:
Код:
CMD:sethours(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 5) { new targetid, hours, string[150]; if(sscanf(params, "ud", targetid, hours)) return SendClientMessage(playerid, -1, "{FF8C00}[USAGE] {FFFFFF}/sethours [playerid] [hours]"); PlayerInfo[targetid][pHours] = hours; format(string, sizeof(string), "{FF8C00}[INFO] {FFFFFF}You edited %s's hours to %d.", targetid, hours); SendClientMessage(playerid, -1, string); SendClientMessage(targetid, -1, "{FF8C00}[INFO] {FFFFFF}Your hours were edited. Check your /stats."); return 1; } else return SendClientMessage(playerid, -1, "{FF0000}[ERROR] {FFFFFF}You are unauthorized to use this command."); 
return 1;}
Reply
#4

nah when i type it in game its say Unknown Command.
Reply
#5

Код:
CMD:sethours(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 5)
	{
 		new iPlayer, hours, string[150];
 	    if(sscanf(params, "ud", iPlayer, hours)) return SendClientMessage(playerid, -1, "{FF8C00}[USAGE] {FFFFFF}/sethours [playerid] [hours]");
 	    if(!IsPlayerConnected(iPlayer)) return SendClientError(playerid, PLAYER_NOT_FOUND);
		format(string, sizeof(string), "{FF8C00}[INFO] {FFFFFF}You edited %s's hours to %d.", iPlayer, hours);
		SendClientMessage(playerid, -1, string);
		SendClientMessage(targetid, -1, "{FF8C00}[INFO] {FFFFFF}Your hours were edited. Check your /stats.");
		PlayerInfo[iPlayer][pHours] = hours;
	}
	else return SendClientMessage(playerid, -1, "{FF0000}[ERROR] {FFFFFF}You are unauthorized to use this command.");
	return 1;
}
try this one.
Reply
#6

still not working.
Reply
#7

Код:
CMD:sethours(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 5) return SendClientMessage(playerid, -1, "{FF0000}[ERROR] {FFFFFF}You are unauthorized to use this command.");
	new iPlayer, iHours;
	if( sscanf ( params, "ud", iPlayer, iHours)) return SCP(playerid, "[PlayerID/PartOfName] [lvl]");
	if(!IsPlayerConnected(iPlayer)) return SendClientMessage(playerid, -1 , "Player Not Connected");
	PlayerInfo[iPlayer][pHours]=iHours;
	SendClientMessage(iPlayer, -1, "{FF8C00}[INFO] {FFFFFF}Your hours were edited. Check your /stats.");
	return 1;
}
This must work

Edited.
Reply
#8

Still not working its say SERVER:UNKNOWN COMMAND
Reply
#9

are you using a filterscript or a gamemode ??
Reply
#10

Gamemode
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)