SA-MP Forums Archive
quit and save position - 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)
+--- Thread: quit and save position (/showthread.php?tid=307386)



quit and save position - HondaCBR - 30.12.2011

im using /qs which saves your position when you quit, after it saved Im using Kick(playerid), that only does "server closed the conection" is the a way of accually disconnecting from samp like when you use /q ?


Re: quit and save position - vassilis - 30.12.2011

no 2char.


Re: quit and save position - Spooky - 30.12.2011

Use this
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
       new x, y, z;
       GetPlayerPos(playerid, x, y, z);
       return 1;
}



AW: Re: quit and save position - BigETI - 30.12.2011

Quote:
Originally Posted by Spooky
Посмотреть сообщение
Use this
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
       new x, y, z;
       GetPlayerPos(playerid, x, y, z);
       return 1;
}
looks like someone didn't read the topic.
First of all you have to use the Float: tag on the variables and second he asked about a function which does like /q.

There is no function like /q but you can try to crash the client.


Re: quit and save position - Spooky - 30.12.2011

Oops Sorry

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
       new Float:x, Float:y, Float:z;
       GetPlayerPos(playerid, x, y, z);
       return 1;
}



Re: quit and save position - HondaCBR - 30.12.2011

No I better not crash anything, its fine they'll have to use /qs and /q after

one more thing when they do that im using a bubble, so people around know that they just left (this is in case you chase someone they go round the corner and leave, so you dont run around looking for them like an idiot as you will see a bubble text saying their name and what they used "/q" or "/qs")

pawn Код:
if (strcmp("/qs", cmdtext, true, 10) == 0)
    {
        PlayerInfo[playerid][pQS] = 1;
        PlayerInfo[playerid][pIntQS] = GetPlayerInterior(playerid);

        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        PlayerInfo[playerid][pPos_xQS] = x;
        PlayerInfo[playerid][pPos_yQS] = y;
        PlayerInfo[playerid][pPos_zQS] = z;

        new plname2[MAX_PLAYER_NAME];
        GetPlayerName(playerid, plname2, sizeof(plname2));
        new string3[256];
        format(string3, sizeof(string3), "%s:\n(( /qs ))",plname2);
        SetPlayerChatBubble(playerid, string3, COLOR_WHITE, 15.0, 12000);
        Kick(playerid);
    }

    if (strcmp("/q", cmdtext, true, 10) == 0)
    {
        new plname2[MAX_PLAYER_NAME];
        GetPlayerName(playerid, plname2, sizeof(plname2));
        new string3[256];
        format(string3, sizeof(string3), "%s:\n(( /q ))",plname2);
        SetPlayerChatBubble(playerid, string3, COLOR_WHITE, 15.0, 12000);
    }
The problem is that the bubble doesnt appear, I just want the bubble to appear and stay there for 12s and then disapear.

Or insted of using commandtext, should I use onplayerdisconnect, and then the disconnect reason?


Re: quit and save position - silvan - 30.12.2011

I dunno if Kye fix it but in the old days client will crash if you try to " give " a weapon to someone with an invalid ID for example weapon ID 100 don't exist... so if you do

pawn Код:
GivePlayerWeapon(playerid,100,1);
it used to crash the client but now i'm not using it anymore because i don't need it.


Re: quit and save position - Face9000 - 30.12.2011

Quote:
Originally Posted by silvan
Посмотреть сообщение
I dunno if Kye fix it but in the old days client will crash if you try to " give " a weapon to someone with an invalid ID for example weapon ID 100 don't exist... so if you do

pawn Код:
GivePlayerWeapon(playerid,100,1);
it used to crash the client but now i'm not using it anymore because i don't need it.
Tried it already for a test in my script with invalid wep id.It gives you the normal message "Invalid weapon ID".

You can't emulate /q command because is included in sa-mp client.You can try to create multi explosions at same time so it will crash. (if u want crash),if not,you can't do anything.


Re: quit and save position - HondaCBR - 30.12.2011

Yes thx, never mind the /q command, I want to know how to display that bubble, because it goes when you leave.


Re: quit and save position - Face9000 - 30.12.2011

Quote:
Originally Posted by HondaCBR
Посмотреть сообщение
Yes thx, never mind the /q command, I want to know how to display that bubble, because it goes when you leave.
Explain better please,what "bubble" u want show?