SA-MP Forums Archive
How to do this code when you add kills reads... - 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: How to do this code when you add kills reads... (/showthread.php?tid=255687)



How to do this code when you add kills reads... - Join7 - 16.05.2011

How to do this code when you add kills reads "You add x kills a player PlayerName "?

Код:
if(strcmp(cmd, "/setkill", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setkill [Playerid/PartOfName] [kills]");
				return 1;
			}
			new playa;
			new kills1;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			kills1 = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 4)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa!= INVALID_PLAYER_ID)
			        {
						PlayerInfo[playa][pKills] = kills1;
						SetPlayerScore(playa, PlayerInfo[playa][pKills]);
					}
				}
			}
		}
		return 1;
	}