"/unlock" <-- Unlocking players.. (NOT CAR-RELATED)
#1

Код:
if (strcmp(cmd, "/unlock", true)==0)
	{
	  if((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >=3)
	  {
	    tmp = strtok(cmdtext, idx);
	    if(!strlen(tmp))
			{
		    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unlock [PlayerName_PlayerLastName]");
	      return 1;
		 	}
		 	GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		 	GetPlayerName(playerid, sendername, sizeof(giveplayer));
		 	format(string, 256, "AdmWarning: %s has unlocked %s", sendername, tmp);
		 	ABroadCast(COLOR_ASKQ,string,1);
			format(string, 256, "AdmWarning: %s has unlocked %s", sendername, tmp);
			printf(string);
			format(string,sizeof(string),"%s.ini",tmp);
			fremove(string);
			SendClientMessage(playerid, COLOR_WHITE, "Player unlocked");
	    PlayerInfo[giveplayerid][pLocked] = 0;
  			GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
			GetPlayerName(playerid, sendername, sizeof(sendername));
		}
		return 1;
	}
It doesnt work.. all i did was really copy + paste "/unban", but it doesn't work :/
Reply
#2

Quote:
Originally Posted by marszim
Код:
if (strcmp(cmd, "/unlock", true)==0)
	{
	  if((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >=3)
	  {
	    tmp = strtok(cmdtext, idx);
	    if(!strlen(tmp))
			{
		    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unlock [PlayerName_PlayerLastName]");
	      return 1;
		 	}
		 	GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		 	GetPlayerName(playerid, sendername, sizeof(giveplayer));
		 	format(string, 256, "AdmWarning: %s has unlocked %s", sendername, tmp);
		 	ABroadCast(COLOR_ASKQ,string,1);
			format(string, 256, "AdmWarning: %s has unlocked %s", sendername, tmp);
			printf(string);
			format(string,sizeof(string),"%s.ini",tmp);
			fremove(string);
			SendClientMessage(playerid, COLOR_WHITE, "Player unlocked");
	    PlayerInfo[giveplayerid][pLocked] = 0;
 			GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
			GetPlayerName(playerid, sendername, sizeof(sendername));
		}
		return 1;
	}
It doesnt work.. all i did was really copy + paste "/unban", but it doesn't work :/
Does it check for pLocked on playerspawn? if it doesnt then add the correct text, maybe you wrote pBanned?.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)