SA-MP Forums Archive
warn scritp needed - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: warn scritp needed (/showthread.php?tid=172314)



warn script needed - cssbart - 29.08.2010

can any on turn this in to a warn script and after 5 warnings it bans them

Код:
 	if(strcmp(cmd, "/setadmin", true) == 0 || strcmp(cmd, "/makeadmin", true) == 0)
	{
        new player[MAX_PLAYER_NAME];
        if(PlayerInfo[playerid][Admin] < 7) return SendClientMessage(playerid, RED, "You Have To Be A Level 7 Admin To Use This!");
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setadmin or /makeadmin [playerid] [AdminLevel]");
		giveplayerid = ReturnUser(tmp);
        tmp = strtok(cmdtext, idx);
        new level = strval(tmp);
       	if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID.");
       	GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, player, sizeof(player));
        PlayerInfo[giveplayerid][Admin] = level;
        printf("Admin %s made %s a level %d admin.", player, giveplayer, level);
        format(string, sizeof(string), "Admin \"%s\" has set your Admin Level to %d.",player, level);
        SendClientMessage(giveplayerid, COLOR_GREEN, string);
        format(string, sizeof(string), "You have given \"%s\" level %d admin.", giveplayer, PlayerInfo[giveplayerid][Admin]);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
       	return 1;
	}



Re: warn scritp needed - Arrows73 - 01.09.2010

Make a Variable, e.g.

new PlayerVar_Warnings[MAX_PLAYERS];

On connect and Disconnect, set it to 0.

Make a command, which increases the Warnings of the Targeted player
if They are e.g. 5 or whatever, kick the player

Done


Re: warn scritp needed - cssbart - 01.09.2010

thanks but i got one now and i think it works so thanks for your time