Using a command while a player isn't connected. - 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: Using a command while a player isn't connected. (
/showthread.php?tid=86978)
Using a command while a player isn't connected. -
-eXo - 17.07.2009
Is it possible to like edit a user's ini file if they aren't connected?.
For example, its only me on the server and I want to set a player who is offline to jailed=1.
Re: Using a command while a player isn't connected. -
MenaceX^ - 17.07.2009
Depends what you use.
Re: Using a command while a player isn't connected. -
Outbreak - 17.07.2009
i did sometihng liek this in mine. First i did it for unbanning and banning players who arent connected to the server. By using /nban [playername] and /unban [playername]
Also got it working with /setpass [playername]
First, have you wrote anything so far that you've tried?
If you have post it here and i'll be able to help you more with that. Otherwise its a little bit of guess work for some parts, but should still be fine.
Re: Using a command while a player isn't connected. -
-eXo - 17.07.2009
Well basically, my goal is to be able to admin jail player's who aren't connected to the server. Here is the command:
Код:
if(strcmp(cmd, "/ajail", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ajail [playerid/PartOfName] [time(minutes)] [reason]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ajail [playerid/PartOfName] [time(minutes)] [reason]");
return 1;
}
format(string, sizeof(string), "* You Jailed %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* You were Jailed by Admin %s.", sendername);
SendClientMessage(playa, COLOR_LIGHTRED, string);
SafeResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
PlayerInfo[playa][pJailed] = 1;
PlayerInfo[playa][pJailTime] = money*60;
SetPlayerInterior(playa, 6);
PlayerInfo[playa][pInt] = 6;
SetPlayerPos(playa, 264.6288,77.5742,1001.0391);
format(string, sizeof(string), "You are jailed for %d minutes. Bail: Unable", money);
SendClientMessage(playa, COLOR_WHITE, string);
format(string, 256, "%s has been jailed by %s [Reason: %s]", giveplayer, sendername, (result));
BroadCast(COLOR_LIGHTRED,string);
format(string, sizeof(string), "%s has been jailed by %s [Reason: %s]", giveplayer, sendername, (result));
printf("%s",string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}
Re: Using a command while a player isn't connected. -
-eXo - 18.07.2009
Anyone know if its possible? and if it is how would I go about doing so?.