SA-MP Forums Archive
Problem : Crash and /q - 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: Problem : Crash and /q (/showthread.php?tid=93266)

Pages: 1 2


Problem : Crash and /q - LiDeRu`s - 24.08.2009

How to do that when you get crash or / q deie you all in the same place where you gave / q or crash took

Thanks to all who want to help me


Re: Problem : Crash and /q - XtremeChio - 24.08.2009

Delete - I couldn't understand what you wanted, can't blame me for your English..


Re: Problem : Crash and /q - J.W. - 24.08.2009

Quote:
Originally Posted by XtremeChio
Код:
	if(strcmp(cmdtext, "/q", true) == 0)
	{
 	  SetPlayerHealth(playerid,0);
		return 1;
	}
Lawl
Wow, you fucking funny?


Re: Problem : Crash and /q - Energyzer - 24.08.2009

Follow these steps:

1. Add this on enum pInfo:
pawn Код:
pCrashed,
2. Add this in OnPlayerConnect:
pawn Код:
PlayerInfo[playerid][pCrashed] = 0;
3. Add this in OnPlayerDisconnect:
pawn Код:
if(reason == 0)
    {
      PlayerInfo[playerid][] = 1;
      for(new slot = 0; slot != 12; slot++)
      {
        new wep, ammo;
        GetPlayerWeaponData(playerid, slot, wep, ammo);
       
        if(wep != 0 && ammo != 0)
        {
          if(PlayerInfo[playerid][pGun1] == 0) { PlayerInfo[playerid][pGun1] = wep; PlayerInfo[playerid][pAmmo1] = ammo; }
          else if(PlayerInfo[playerid][pGun2] == 0) { PlayerInfo[playerid][pGun2] = wep; PlayerInfo[playerid][pAmmo2] = ammo; }
          else if(PlayerInfo[playerid][pGun3] == 0) { PlayerInfo[playerid][pGun3] = wep; PlayerInfo[playerid][pAmmo3] = ammo; }
          else if(PlayerInfo[playerid][pGun4] == 0) { PlayerInfo[playerid][pGun4] = wep; PlayerInfo[playerid][pAmmo4] = ammo; }
        }
      }
    }
4. Add this in SetPlayerSpawn:
pawn Код:
if(PlayerInfo[playerid][pCrashed] == 1)
        {
          if(TutTime[playerid] == 0 && PlayerInfo[playerid][pTut] == 1 && RegistrationStep[playerid] == 0 && AfterTutorial[playerid] == 0 && FirstSpawn[playerid] == 1)
          {
            SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pVirWorld]);
            SetPlayerInterior(playerid,PlayerInfo[playerid][pInt]);
            SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z] + 1);
            //SendClientMessage(playerid, COLOR_WHITE, "Crashed, returning where you been.");
            //GameTextForPlayer(playerid, "~p~Crashed~n~~w~returning where you been", 5000, 1);
            return 1;
            }
        }
5. Add this in OnPlayerRegister:
pawn Код:
format(var, 64, "Crashed=%d\n",PlayerInfo[playerid][pCrashed]);fwrite(hFile, var);
6. Add this in OnPlayerLogin:
pawn Код:
if( strcmp( key , "Crashed" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCrashed] = strval( val ); }
7. Add this in OnPlayerLogin:
pawn Код:
if(PlayerInfo[playerid][pCrashed] == 0)
        {
            format(tmp2, sizeof(tmp2), "~w~Welcome ~n~~y~  %s", playername);
        }
        else
        {
        format(tmp2, sizeof(tmp2), "~p~Crashed...~n~~w~Returning where you been");
        }
8. Add this in anywhere:
pawn Код:
forward UnsetCrash(playerid)
public UnsetCrash(playerid)
{
    if(IsPlayerConnected(playerid))
    {
      PlayerInfo[playerid][pCrashed] = 0;
    }
    return 1;
}
9. Add this in OnPlayerLogin:
pawn Код:
// Unset Crash
        SetTimerEx("UnsetCrash", 5000, false, "i", playerid);
This code is create for LA-RP Team, if you have some errors give me.


Re: Problem : Crash and /q - XtremeChio - 24.08.2009

Delete


Re: Problem : Crash and /q - XtremeChio - 24.08.2009

Oh I didn't get the meaning..I thought you wanted that when someone does /q, he dies on the screen for others.
I coulnd't understand your English


Re: Problem : Crash and /q - LiDeRu`s - 24.08.2009

Errors

pawn Код:
D:\samp\gamemodes\gf.pwn(2692) : error 017: undefined symbol "reason"
D:\samp\gamemodes\gf.pwn(2694) : error 029: invalid expression, assumed zero
D:\samp\gamemodes\gf.pwn(2694) : error 029: invalid expression, assumed zero
D:\samp\gamemodes\gf.pwn(2694) : error 029: invalid expression, assumed zero
D:\samp\gamemodes\gf.pwn(2694) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
pawn Код:
(2692) if(reason == 0)
    {
      (2694)PlayerInfo[playerid][] = 1;
      for(new slot = 0; slot != 12; slot++)
      {
        new wep, ammo;
        GetPlayerWeaponData(playerid, slot, wep, ammo);
       
        if(wep != 0 && ammo != 0)
        {
          if(PlayerInfo[playerid][pGun1] == 0) { PlayerInfo[playerid][pGun1] = wep; PlayerInfo[playerid][pAmmo1] = ammo; }
          else if(PlayerInfo[playerid][pGun2] == 0) { PlayerInfo[playerid][pGun2] = wep; PlayerInfo[playerid][pAmmo2] = ammo; }
          else if(PlayerInfo[playerid][pGun3] == 0) { PlayerInfo[playerid][pGun3] = wep; PlayerInfo[playerid][pAmmo3] = ammo; }
          else if(PlayerInfo[playerid][pGun4] == 0) { PlayerInfo[playerid][pGun4] = wep; PlayerInfo[playerid][pAmmo4] = ammo; }
        }
      }
    }
}



Re: Problem : Crash and /q - Energyzer - 24.08.2009

Removed this and solved, is my error.

pawn Код:
(2692) if(reason == 0)
{
 (2694) PlayerInfo[playerid][] = 1;
  for(new slot = 0; slot != 12; slot++)
  {
    new wep, ammo;
    GetPlayerWeaponData(playerid, slot, wep, ammo);
   
    if(wep != 0 && ammo != 0)
    {
      if(PlayerInfo[playerid][pGun1] == 0) { PlayerInfo[playerid][pGun1] = wep; PlayerInfo[playerid][pAmmo1] = ammo; }
      else if(PlayerInfo[playerid][pGun2] == 0) { PlayerInfo[playerid][pGun2] = wep; PlayerInfo[playerid][pAmmo2] = ammo; }
      else if(PlayerInfo[playerid][pGun3] == 0) { PlayerInfo[playerid][pGun3] = wep; PlayerInfo[playerid][pAmmo3] = ammo; }
      else if(PlayerInfo[playerid][pGun4] == 0) { PlayerInfo[playerid][pGun4] = wep; PlayerInfo[playerid][pAmmo4] = ammo; }
    }
  }
}
}



Re: Problem : Crash and /q - LiDeRu`s - 24.08.2009

oh my god....
same error


Re: Problem : Crash and /q - [mad]MLK - 24.08.2009

you carnt have a /q command its a samp command


Re: Problem : Crash and /q - LiDeRu`s - 24.08.2009

I do not want it out

but when I want cinava yes / q deie him in the same place where he gave / q


Re: Problem : Crash and /q - Energyzer - 24.08.2009

REMOVE, not replace, REMOVE THAT PART.


Re: Problem : Crash and /q - LiDeRu`s - 24.08.2009

ok


Re: Problem : Crash and /q - LiDeRu`s - 24.08.2009

pawn Код:
D:\samp\gamemodes\gf.pwn(2919) : warning 225: unreachable code
D:\samp\gamemodes\gf.pwn(2921) : error 029: invalid expression, assumed zero
D:\samp\gamemodes\gf.pwn(2921) : error 029: invalid expression, assumed zero
D:\samp\gamemodes\gf.pwn(2921) : warning 215: expression has no effect
D:\samp\gamemodes\gf.pwn(2921) : error 001: expected token: ";", but found "if"
D:\samp\gamemodes\gf.pwn(2921) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
now gives me error if they put


Re: Problem : Crash and /q - Energyzer - 24.08.2009

What code?


Re: Problem : Crash and /q - LiDeRu`s - 24.08.2009

Код:
		if(PlayerInfo[playerid][pCrashed] == 1)
		{
		  if(TutTime[playerid] == 0 && PlayerInfo[playerid][pTut] == 1 && RegistrationStep[playerid] == 0 && AfterTutorial[playerid] == 0 && FirstSpawn[playerid] == 1)
		  {
		    SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pVirWorld]);
		    SetPlayerInterior(playerid,PlayerInfo[playerid][pInt]);
		  	SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z] + 1);
		  	//SendClientMessage(playerid, COLOR_WHITE, "Crashed, returning where you been.");
		  	//GameTextForPlayer(playerid, "~p~Crashed~n~~w~returning where you been", 5000, 1);
		  	return 1;
			}
		}
	}
	return 1;
}



Re: Problem : Crash and /q - CAR - 24.08.2009

I wanted this too.

Must be at OnPlayerDisconnect.
I don't know how to do this...
by me don't work.


Re: Problem : Crash and /q - LiDeRu`s - 24.08.2009

nobody even knows something ?
to me to tell me specifically how to do..

thx


Re: Problem : Crash and /q - NinjaCroko - 08.09.2009

hehe , just 1/4 from this forum use roleplay mode , and can`t help you.


Re: Problem : Crash and /q - Abernethy - 08.09.2009

This might come in handy?

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{

  new pName[MAX_PLAYER_NAME], string[56];
  GetPlayerName(playerid, pName, sizeof(pName));
  switch(reason)
  {
    case 0: format(string, sizeof(string), "[ ! ] %s has left the server. (Lost Connection)", pName);
    case 1: format(string, sizeof(string), "[ ! ] %s has left the server. (Leaving)", pName);
    case 2: format(string, sizeof(string), "[ ! ] %s has left the server. (Kicked/Banned)", pName);
  }
  SendClientMessageToAll(0x000000AA, string);
    return 1;
}