How can I do this? - 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 can I do this? (
/showthread.php?tid=197869)
How can I do this? -
Tessar - 10.12.2010
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.
Re: How can I do this? -
Kaylux - 10.12.2010
How are you defining these values?
What file system are you using and how are you using it?
Re: How can I do this? -
Tessar - 10.12.2010
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
Re: How can I do this? -
Kaylux - 10.12.2010
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.