SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 18/03/2017, 12:57 PM   #1
Pokemon64
Huge Clucker
 
Join Date: Nov 2016
Posts: 213
Reputation: 1
Default How to fix explosion after death (PROBLEM)

Hi
so i go straight to the point problem is that if you're red team your ability is that you get explosion after death, right? So if round is over and starting other you randomly selected now to Blue team so if red team kill you, you get explode bat it shouldn't work like this. Explosion on that only should have red team. So idk whats wrong

I'm pretty sure it would be problem with all OnPlayerDeath callback because off { }
Bat anyway code of ability
Code:
    if(pInfo[playerid][pRedClass] == BOOMER)
    {
    new explodecount;
    GetPlayerPos(playerid,Float:x,Float:y,Float:z);
    CreateExplosion(Float:x,Float:y,Float:z,0,6.0);

    foreach(new i : Player)
    {
    if(!IsPlayerConnected(i)) continue;
    if(i == playerid) continue;
    if(pInfo[i][pRedClass] == BOOMER) continue;
    if(IsPlayerInRangeOfPoint(i,7.0,Float:x,Float:y,Float:z))
    {
    if(pInfo[i][IsPlayerInfected] == 0)
    {
    InfectPlayerStandard(i);
    explodecount++;
    }
    }
    }

    if(explodecount > 0)
    {
    new zmstring2[256],pNames[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pNames,sizeof(pNames));
    format(zmstring2,sizeof(zmstring2),""COL_GREEN"%s has been exploded "COL_WHITE"%i players.",pNames,explodecount);
    SendClientMessageToAll(-1,zmstring2);
    }
    }
    }
If you no see any problem here send me private message because i dont want drop all "OnPlayerDeath" callback here.
Pokemon64 is offline   Reply With Quote
Old 18/03/2017, 01:48 PM   #2
lackmail
Big Clucker
 
Join Date: Aug 2016
Posts: 80
Reputation: 13
Default Re: How to fix explosion after death (PROBLEM)

do you change pRedClass from BOOMER to another thing when player selected in blue team?
lackmail is offline   Reply With Quote
Old 18/03/2017, 01:52 PM   #3
Pokemon64
Huge Clucker
 
Join Date: Nov 2016
Posts: 213
Reputation: 1
Default Re: How to fix explosion after death (PROBLEM)

No i dont. It saved i think. Because if next round you will be again Red team so BOOMER class will stay until you dont change it. So somehow need remove that ability if you are in Blue team. Bat i dont know how
Pokemon64 is offline   Reply With Quote
Old 18/03/2017, 01:56 PM   #4
lackmail
Big Clucker
 
Join Date: Aug 2016
Posts: 80
Reputation: 13
Default Re: How to fix explosion after death (PROBLEM)

then you have to check player team first then check if pRedClass == BOOMER

example:
Code:
if(Team[playerid] == TEAM_RED && pInfo[playerid][pRedClass] == BOOMER)
lackmail is offline   Reply With Quote
Old 18/03/2017, 02:02 PM   #5
henkas
Huge Clucker
 
Join Date: May 2015
Posts: 347
Reputation: 8
Default Re: How to fix explosion after death (PROBLEM)

Quote:
Originally Posted by lackmail View Post
then you have to check player team first then check if pRedClass == BOOMER

example:
Code:
if(Team[playerid] == TEAM_RED && pInfo[playerid][pRedClass] == BOOMER)
It will not work.
henkas is offline   Reply With Quote
Old 18/03/2017, 02:03 PM   #6
Pokemon64
Huge Clucker
 
Join Date: Nov 2016
Posts: 213
Reputation: 1
Default Re: How to fix explosion after death (PROBLEM)

Quote:
Originally Posted by lackmail View Post
then you have to check player team first then check if pRedClass == BOOMER

example:
Code:
if(Team[playerid] == TEAM_RED && pInfo[playerid][pRedClass] == BOOMER)
I tried it already. Nothing changed.
Pokemon64 is offline   Reply With Quote
Old 18/03/2017, 02:14 PM   #7
coool
Gangsta
 
coool's Avatar
 
Join Date: Feb 2013
Location: Republic of Pakistan
Posts: 591
Reputation: 54
Default Re: How to fix explosion after death (PROBLEM)

Try
Quote:
if(!pInfo[playerid][pBlueClass] == BOOMER)
Within the pRedClass's if statement
__________________
coool is online now   Reply With Quote
Old 18/03/2017, 02:20 PM   #8
Pokemon64
Huge Clucker
 
Join Date: Nov 2016
Posts: 213
Reputation: 1
Default Re: How to fix explosion after death (PROBLEM)

Quote:
Originally Posted by coool View Post
Try

Within the pRedClass's if statement
warning 213: tag mismatch
Pokemon64 is offline   Reply With Quote
Old 18/03/2017, 02:36 PM   #9
coool
Gangsta
 
coool's Avatar
 
Join Date: Feb 2013
Location: Republic of Pakistan
Posts: 591
Reputation: 54
Default Re: How to fix explosion after death (PROBLEM)

Can you show how have you put it in and try running that compiled file to see if it works
__________________
coool is online now   Reply With Quote
Old 18/03/2017, 03:03 PM   #10
Pokemon64
Huge Clucker
 
Join Date: Nov 2016
Posts: 213
Reputation: 1
Default Re: How to fix explosion after death (PROBLEM)

Anyway i tried
if(!pInfo[playerid][pBlueClass] == BOOMER)
It doesnt work.
Pokemon64 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Death System doesn't respawn correctly after explosion. Dokins Scripting Help 1 14/05/2016 03:26 AM
Vehicle death-by-explosion detection MP2 Scripting Help 5 22/01/2014 08:16 PM
[FilterScript] [::] Realistic Vehicle Explosion/Death Physics [::] iPLEOMAX Filterscripts 23 02/09/2011 01:38 PM
Crazy Ideas involving Explosion/Death WillyP Help Archive 0 02/09/2010 04:17 PM
Crash after explosion or death hipy Server Support 3 22/12/2008 10:23 PM


All times are GMT. The time now is 03:18 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.