How can I do this?
#1

I don't know if this is the request section if it isn't can you move this post but..
Can somebody help me to make a script that will go on my gamemode that will stop people from spawing on S.W.A.T and Army until i put a 1 in their log.

It would also be a bonus if somebody could make a dcmd command like /givearmy [playerid] /giveswat [playerid]

Thanks for your time.
Reply
#2

How are you defining these values?
What file system are you using and how are you using it?
Reply
#3

Quote:
Originally Posted by Kaylux
Посмотреть сообщение
How are you defining these values?
What file system are you using and how are you using it?
i'm using these by enum
Код:
enum pInfo
{
	Registered,
	LoggedIn,
	AdminLevel,
	Password,
	Score,
	Kills,
	Deaths,
	PlayerIP,
	AccLocked,
};
The Files:
scriptfiles\Tsystem\Users
Reply
#4

You need to set it in the file.

I dont see it already there so.

Код:
enum pInfo
{
	Registered,
	LoggedIn,
	AdminLevel,
	Password,
	Score,
	Kills,
	Deaths,
	PlayerIP,
	AccLocked,
          Type, //Type 1 = Army and Type 2 = S.W.A.T
};
DCMD code would be something like this. Presuming you use sscanf
Код:
dcmd_setteam(playerid, params[])
{
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0x33CCFFFF,"You're not an admin.");
	else
	{
		new
			giveplayerid,
			string[125],
			team;
		if (sscanf(params, "ii", giveplayerid, team)) SendClientMessage(playerid, 0xFF0000AA, "[ERROR] Usage: /setteam [id] [Team ID] - Team 1 = Army, Team 2 = S.W.A.T");
		else
 		{
			pInfo[giveplayerid][Type] = team;
			format(string,sizeof(string),"You set %s team to %d.",GetPlayerNameEx(giveplayerid), team);
			SendClientMessage(playerid,0x33CCFFFF,string);
			return 1;
		}
	}
	return 1;
}
With:
Код:
stock GetPlayerNameEx(playerid)
{
	new n[MAX_PLAYER_NAME];
	GetPlayerName(playerid,n,sizeof(n));
	return n;
}
And then ofcourse, if you wanted to check if the person was army or not. You could just do:

Код:
if(pInfo[playerid][Type] = 1)
{
   Blahh Blahh
}
S.W.A.T would be 2.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)