SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 03/06/2020, 04:38 PM   #11
Ertouq
Huge Clucker
 
Ertouq's Avatar
 
Join Date: Jul 2014
Posts: 236
Reputation: 4
Default Re: another backtrace

bump!
Ertouq is offline   Reply With Quote
Old 03/06/2020, 11:58 PM   #12
jasperschellekens
High-roller
 
jasperschellekens's Avatar
 
Join Date: Dec 2016
Location: Holland
Posts: 1,168
Reputation: 165
Default Re: another backtrace

Quote:
Originally Posted by Ertouq View Post
Uh, I didn't quite understand, could you give me an example?
try this:
pawn Code:
if(PlayerInfo[playerid][inDuel] == 1)
    {
        if(PlayerInfo[playerid][Duelingto] >= 0) {
            new id = PlayerInfo[playerid][Duelingto], Float:health, Float:armour, str[124];
            GetPlayerHealth(id, health);
            GetPlayerArmour(id, armour);
            ResetPlayerWeapons(id);
            SetPlayerVirtualWorld(id, 0);
            SetPlayerInterior(id, 0);
            SetPlayerHealth(id, 100);

            format(str, sizeof(str), "%s abandoned the server in the mid of a duel vs %s. %s is the winner. [%.0f health and %.0f armour]", GetName(playerid), GetName(id), GetName(id), health, armour);
            SendClientMessageToAll(CDUEL, str);

            PlayerInfo[id][Duelingto] = -1;
            PlayerInfo[id][Maker] = -1;
            PlayerInfo[id][Opponent] = -1;
            PlayerInfo[playerid][LoseDuels] ++;
            PlayerInfo[id][WinDuels] ++;
        }
    }
__________________
Undead Wasteland Roleplay | Visit website
The year is 1996. San Andreas is a wasteland ruled by the undead. the once so glorius landscape of San Andreas, is now a shattered decayed place that is only a vague memory of the world as we used to know it.
jasperschellekens is offline   Reply With Quote
Old 04/06/2020, 05:51 AM   #13
Ertouq
Huge Clucker
 
Ertouq's Avatar
 
Join Date: Jul 2014
Posts: 236
Reputation: 4
Default Re: another backtrace

Quote:
Originally Posted by jasperschellekens View Post
try this:
pawn Code:
if(PlayerInfo[playerid][inDuel] == 1)
    {
        if(PlayerInfo[playerid][Duelingto] >= 0) {
            new id = PlayerInfo[playerid][Duelingto], Float:health, Float:armour, str[124];
            GetPlayerHealth(id, health);
            GetPlayerArmour(id, armour);
            ResetPlayerWeapons(id);
            SetPlayerVirtualWorld(id, 0);
            SetPlayerInterior(id, 0);
            SetPlayerHealth(id, 100);

            format(str, sizeof(str), "%s abandoned the server in the mid of a duel vs %s. %s is the winner. [%.0f health and %.0f armour]", GetName(playerid), GetName(id), GetName(id), health, armour);
            SendClientMessageToAll(CDUEL, str);

            PlayerInfo[id][Duelingto] = -1;
            PlayerInfo[id][Maker] = -1;
            PlayerInfo[id][Opponent] = -1;
            PlayerInfo[playerid][LoseDuels] ++;
            PlayerInfo[id][WinDuels] ++;
        }
    }
Thank you. Works fine!
Ertouq 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
backtrace Ertouq Scripting Help 5 29/05/2020 10:57 AM
amx backtrace XSharkX Scripting Help 5 31/05/2018 04:48 PM
AMX Backtrace help ohmy Scripting Help 1 22/05/2018 06:04 AM
AMX backtrace Auri Scripting Help 3 02/02/2016 11:32 AM
AMX Backtrace [+Rep] RayC Scripting Help 2 04/01/2015 07:51 PM


All times are GMT. The time now is 07:49 AM.


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