Help-On player death crash
#1

In taxi fr gm when a player death crash. i have add some object.

Please Help

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
		GivePlayerMoney(killerid, 5000);
		SendDeathMessage(killerid,playerid,reason);

	return 1;
}
Код:
public OnPlayerSpawn(playerid)
{
  if(PlayerInfo[playerid][logged] == 0) {
    SendClientMessage(playerid, COLOR_BRIGHTRED, "-----------------------------------------------------------------------------------------------------------------------");
		SendClientMessage(playerid,COLOR_YELLOW, "You have not logged in yet!");
 		SendClientMessage(playerid,COLOR_YELLOW, "Please register your current player name with '/register [password]' and login with '/login [password]'");
 		SendClientMessage(playerid, COLOR_BRIGHTRED, "-----------------------------------------------------------------------------------------------------------------------");
	}
  SetPlayerColor(playerid,COLOR_GREY);
 	switch(PlayerInfo[playerid][team]) {
	 case TEAM_BALLA: {
	  GivePlayerWeapon(playerid,32,100);
	  GivePlayerWeapon(playerid,25,100);
	  GivePlayerWeapon(playerid,4,1);
	  SetPlayerColor(playerid,COLOR_PINK);
	  if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) {
  			SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]);
  		SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business");
  		return 1;
  	}
	  SetPlayerRandomSpawn(playerid);
	 }
	 case TEAM_GROVE: {
	  GivePlayerWeapon(playerid,28,200);
	  GivePlayerWeapon(playerid,30,200);
	  GivePlayerWeapon(playerid,4,1);
	  SetPlayerColor(playerid,COLOR_GREEN);
	  if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) {
  			SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]);
  		SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business");
  		return 1;
  	}
	  SetPlayerRandomSpawn(playerid);
	 }
	 case TEAM_VAGO: {
	  GivePlayerWeapon(playerid,34,200);
	  GivePlayerWeapon(playerid,24,400);
	  GivePlayerWeapon(playerid,28,800);
	  SetPlayerColor(playerid,COLOR_YELLOW);
	  if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) {
  			SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]);
  		SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business");
  		return 1;
  	}
	  SetPlayerRandomSpawn(playerid);
	 }
	 case TEAM_AZTEC: {
	  GivePlayerWeapon(playerid,24,400);
	  GivePlayerWeapon(playerid,31,800);
	  GivePlayerWeapon(playerid,28,800);
	  SetPlayerColor(playerid,COLOR_BLUE);
	  if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) {
  			SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]);
  		SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business");
  		return 1;
  	}
	  SetPlayerRandomSpawn(playerid);
	 }
	 case TEAM_TRIAD: {
	  GivePlayerWeapon(playerid,27,100);
	  GivePlayerWeapon(playerid,30,200);
	  GivePlayerWeapon(playerid,4,1);
	  SetPlayerColor(playerid,COLOR_YELLOW);
	  if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) {
  			SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]);
  		SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business");
  		return 1;
  	}
	  SetPlayerRandomSpawn(playerid);
	 }
	 case TEAM_MEDIC: {
	  GivePlayerWeapon(playerid,27,100);
	  GivePlayerWeapon(playerid,28,200);
	  GivePlayerWeapon(playerid,4,1);
	  SetPlayerColor(playerid,COLOR_LIGHTBLUE);
	  if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) {
  			SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]);
  		SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business");
  		return 1;
  	}
	  SetPlayerRandomSpawn(playerid);
	 }
	 case TEAM_PTF: {
	  GivePlayerWeapon(playerid,31,800);
	  GivePlayerWeapon(playerid,24,800);
	  GivePlayerWeapon(playerid,27,800);
	 		SetPlayerColor(playerid,COLOR_BRIGHTRED);
	    SetPlayerPos(playerid,2558.4133,1562.1017,10.8203);
	  		return 1;
  	}

	 case TEAM_COP: {
	  GivePlayerWeapon(playerid,24,400);
	  GivePlayerWeapon(playerid,31,400);
	  GivePlayerWeapon(playerid,26,400);
	  SetPlayerColor(playerid,COLOR_BLUE);
	  if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) {
  			SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]);
  		SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business");
  		return 1;
  	}
	  SetPlayerRandomSpawn(playerid);
	 }
	 case TEAM_IF: {
	  GivePlayerWeapon(playerid,24,100);
	  GivePlayerWeapon(playerid,31,200);
	  GivePlayerWeapon(playerid,26,1);
	  SetPlayerColor(playerid,COLOR_GREEN);
	  if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) {
  			SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]);
  		SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business");
  		return 1;
  	}
	  SetPlayerRandomSpawn(playerid);
	 }
	 case TEAM_CIV: {
	  GivePlayerWeapon(playerid,28,200);
	  GivePlayerWeapon(playerid,30,200);
	  GivePlayerWeapon(playerid,4,1);
	  SetPlayerColor(playerid,COLOR_ORANGE);
	  if(PlayerInfo[playerid][logged] == 1 && PlayerInfo[playerid][bowner] == 1) {
  			SetPlayerPos(playerid,BizInfo[PlayerInfo[playerid][bowned]][xpos],BizInfo[PlayerInfo[playerid][bowned]][ypos],BizInfo[PlayerInfo[playerid][bowned]][zpos]);
  		SendClientMessage(playerid,COLOR_GREEN,"You have been spawned at the entrance to your business");
  		return 1;
  	}
	  SetPlayerRandomSpawn(playerid);
	 }
	}
	GivePlayerWeapon(playerid,4,1);
	return 1;
}


stock CountVehicles(filename[]) {
  new File:VehicleFile;
  new blank[256];
  new count = 0;
  if (fexist(V_FILE_SAVE)) {
    VehicleFile = fopen(V_FILE_SAVE);
    while(fread(VehicleFile, blank, sizeof blank)) {
      count++;
    }
    fclose(VehicleFile);
  }
  else {
    VehicleFile = fopen(filename);
    while(fread(VehicleFile, blank, sizeof blank)) {
      count++;
    }
    fclose(VehicleFile);
  }

  return count;
}

stock CountBusinesses(filename[]) {
  new File:BusinessFile;
  new blank[256];
  new count = 0;
  if (fexist(B_FILE_SAVE)) {
    BusinessFile = fopen(B_FILE_SAVE);
    while(fread(BusinessFile, blank, sizeof blank)) {
      count++;
    }
    fclose(BusinessFile);
  }
  else {
    BusinessFile = fopen(filename);
    while(fread(BusinessFile, blank, sizeof blank)) {
      count++;
    }
    fclose(BusinessFile);
  }

  return count;
}

stock split(const strsrc[], strdest[][], delimiter)
{
	new i, li;
	new aNum;
	new len;

	while(i <= strlen(strsrc)){
	  if(strsrc[i]==delimiter || i==strlen(strsrc)){
	    len = strmid(strdest[aNum], strsrc, li, i, 128);
	    strdest[aNum][len] = 0;
	    li = i+1;
	    aNum++;
		}
		i++;
	}
	return 1;
}
Reply
#2

.
Reply
#3

Quote:
Originally Posted by On_Top_Non_Stop
To start with you send a death message without even knowing if there was a killer.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid == INVALID_PLAYER_ID)
    {
        SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
    }
    else
    {
        SendDeathMessage(killerid,playerid,reason);
        GivePlayerMoney(killerid, 5000);
    }
    return 1;
}
http://forum.sa-mp.com/index.php?top....0#post_values
Reply
#4

Orly.. Never knew
Reply
#5

Thanks Guys
Reply
#6

Quote:
Originally Posted by kc
Quote:
Originally Posted by On_Top_Non_Stop
To start with you send a death message without even knowing if there was a killer.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid == INVALID_PLAYER_ID)
    {
        SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
    }
    else
    {
        SendDeathMessage(killerid,playerid,reason);
        GivePlayerMoney(killerid, 5000);
    }
    return 1;
}
http://forum.sa-mp.com/index.php?top....0#post_values
I maked it but the game crash
Reply
#7

Quote:
Originally Posted by [SsC11
MAVERIK ]
Quote:
Originally Posted by kc
Quote:
Originally Posted by On_Top_Non_Stop
To start with you send a death message without even knowing if there was a killer.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid == INVALID_PLAYER_ID)
    {
        SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
    }
    else
    {
        SendDeathMessage(killerid,playerid,reason);
        GivePlayerMoney(killerid, 5000);
    }
    return 1;
}
http://forum.sa-mp.com/index.php?top....0#post_values
I maked it but the game crash
the reason is:
- to much objects
- to much cars
and the other things
Reply
#8

i have delete some object the game don't crash
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)