Quit game
#1

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

Thanks,
Reply
#2

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

Gr Artix
Reply
#3

you mean Kick(playerid); ?
Reply
#4

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

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

it gives me a server: unknown command
Reply
#7

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
Reply
#8

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.
Reply
#9

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

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

Not ideal I know but it's an option.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)