SA-MP Forums Archive
Quit game - 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: Quit game (/showthread.php?tid=90013)



Quit game - MPKaboose - 05.08.2009

what functions should I use that when a player selects the menu Quit he exits the game (SA-MP)

Thanks,


Re: Quit game - Doppeyy - 05.08.2009

if the player chooses Exit you should make that it automaticly types /q
but i dont know how to do that exactly

Gr Artix


Re: Quit game - dafel2 - 05.08.2009

you mean Kick(playerid); ?


Re: Quit game - MPKaboose - 05.08.2009

sorry for the late replay exactly what [RiFA]Artix told


Re: Quit game - Correlli - 05.08.2009

Try this:
pawn Код:
CallLocalFunction("OnPlayerCommandText", "is", playerid, "/q");
This should call the quit command.


Re: Quit game - MPKaboose - 05.08.2009

it gives me a server: unknown command


Re: Quit game - JaTochNietDan - 05.08.2009

The quit command "/q" and "/quit" are hardcoded into the SA-MP client, they do not call OnPlayerCommandText . So you can not force a player to use "/q" to quit the game :P


Re: Quit game - Westie - 05.08.2009

Quote:
Originally Posted by Don Correlli
Try this:
pawn Код:
CallLocalFunction("OnPlayerCommandText", "is", playerid, "/q");
This should call the quit command.
Quote:
Originally Posted by > I misread that above quote...
CallLocalFunction is not for commands, it returns public functions/variables from within that instance of the PAWN VM (that particular gamemode). There is no way I know whatsoever of forcing a user to quit.
I misread that. /q is a function that handled internally by the client.


Re: Quit game - MPKaboose - 05.08.2009

Ok so that can't be done thanks for the help, I will crash the client then joking xD


Re: Quit game - Donny_k - 05.08.2009

Spawn an invalid player object or something, something to make the player crash ?

Not ideal I know but it's an option.