Small Command isnt working (overview it please) -
up2u - 09.05.2011
Код:
if (strcmp(cmd, "/sajail", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (GetPVarInt(playerid, "PlayerLogged") != 0)
{
GetPlayerName(playerid, name, sizeof(name));
CMDLog(name,cmdtext);
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);
ResetPlayerWeaponsEx(playa);
PlayerInfo[playa][pJailed] = 2;
PlayerInfo[playa][pJailTime] = money*60;
PlayerInfo2[Mute][playa] = 1;
SetPlayerInterior(playa, 0);
SetPlayerVirtualWorld(playa, playa);
PlayerInfo[playa][pInt] = 0;
DOO_SetPlayerPos(playa,2523.9197,-1673.8944,14.8589);
TogglePlayerControllableEx(playa, 0);
format(string, sizeof(string), "AdmCmd: %s has been jailed by Admin Silent Admin [Reason: %s]", giveplayer, (result));
ABroadCast(COLOR_YELLOW,string,1);
strmid(PlayerInfo[playa][pJailReason], result, 0, strlen(result), 255);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "AdmCmd: %s has been jailed by Admin %s for %i mins [Reason: %s]", giveplayer, sendername,money,(result));
OnPlayerDataSave(playa);
PlayerInfo[playa][pAJails] += 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Fuck Off!");
}
}
return 1;
}
I dont understand why the fuck it isnt working.
If i type /sajail in game it says Nothing.
Re: Small Command isnt working (overview it please) -
Zh3r0 - 09.05.2011
because your command works only on you! And why the hell you check if YOU are connected to the server?
It's LOGIC that you are connected to the server and you type the command.
Learn using ZCMD and SSCANF and everything will be OK.
Next time, less swearing ..
Re: Small Command isnt working (overview it please) -
up2u - 09.05.2011
Dude this didnt help me sorry.
Can you give me The Pawno code That will be just like above... But than working <3
So.. Just an command that everyone can use, That jails someone.
Can you make that please because this is the first time i see such an script (Just DLed everything)
Re: Small Command isnt working (overview it please) -
Vince - 09.05.2011
Quote:
Originally Posted by Zh3r0
because your command works only on you! And why the hell you check if YOU are connected to the server?
It's LOGIC that you are connected to the server and you type the command.
|
That's because in sa:mp 0.1b, people could still execute commands after being kicked from the server. People then just started copying these scripts without looking. It makes absolutely no sense to still do it right now though.
As for that code: It looks like you copy-pasted some stuff, because it makes absolutely no sense.
pawn Код:
format(string, sizeof(string), "* You Jailed %s.", giveplayer);
Where does that
giveplayer variable come from?
Conclusion: In general, do not copy-paste stuff and certainly don't if you don't know what you're doing in the first place.
Re: Small Command isnt working (overview it please) -
up2u - 09.05.2011
DUde im new with this i just want this stuff to Work...
Please edit my Pawno code in my post so it will work...
Re: Small Command isnt working (overview it please) -
up2u - 09.05.2011
Please help me fix this, Just edit the Code i poster to make it work
Please...