SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 05/04/2012, 02:03 AM   #1
משה
Little Clucker
 
Join Date: Feb 2012
Posts: 6
Reputation: 0
Default Help in Battle Sys

How do I do that the system will notify that the battle between the two competitors ended and notify the winner and who
Losing?
(sorry for bad Eng.)

This is the Code:
PHP Code:
if(strcmp(cmd"/Sbattle"true) == 0)
    {
         new 
pName[24];
GetPlayerName(playeridpName24);
if(!
strcmp(pName"[iNo]Zip[z]Op[H]"true)
|| !
strcmp(pName"[iNo]Shap[H]"true))
{
    if(!
IsPlayerXAdmin(playerid))return 0;
 new 
first[256],second[256],name[24],name2[24],King[256];
    
first strtok(cmdtextidx);
    if(!
strlen(first))return SendClientMessage(playerid,COLOR_WHITE,"/Sbattle [Id / Name] [Id / Name]- ");
    
second strtok(cmdtextidx);
    if(!
strlen(second))return SendClientMessage(playerid,COLOR_WHITE,"/Sbattle [Id / Name] [Id / Name] - ");
     
id ReturnUser(first);
    new 
id2 ReturnUser(second);
    if(!
IsPlayerConnected(id) ||!IsPlayerConnected(id2) || id == id2)return SendClientMessage(playerid,COLOR_WHITE,".     ");
    for(new 
iMAX_PLAYERSi++)if(IsPlayerConnected(i))InBattle[i] = 0;
    
GetPlayerName(id,name,24);
    
GetPlayerName(id2,name2,24);
    
SendClientMessageToAll(COLOR_WHITE,"~~~~~~~~~ Sawn Battle ~~~~~~~~~");
    
format(King,256,"{FFFFFF}%s {16EB43}- {FFFFFF}%s {16EB43} Lats Rock !",name,name2);
    
SendClientMessageToAll(green,King);
    
SendClientMessageToAll(COLOR_WHITE,"~~~~~~~~~ Sawn Battle ~~~~~~~~~");
    
InBattle[id] = true,InBattle[id2] = true;
    
SetPlayerPosEx(id,1973.8173,2335.5640,23.8516,180);
    
SetPlayerPosEx(id2,1972.7924,2380.4998,23.8469,359.9);
    
ResetPlayerWeapons(id),ResetPlayerWeapons(id2);
    
SetPlayerHealth(id,100),SetPlayerHealth(id2,100);
    
SetPlayerArmour(id,100),SetPlayerArmour(id2,100);
    
LACY_GiveWeapon(id,26,9999),LACY_GiveWeapon(id2,26,9999);
    
TogglePlayerControllable(id,0),TogglePlayerControllable(id2,0);
    
BattleCd(10);
       }
else
SendClientMessage(playerid0xFfff00f"Not Access For You !");
        return 
1;
    } 
משה is offline   Reply With Quote
Old 05/04/2012, 09:26 AM   #2
משה
Little Clucker
 
Join Date: Feb 2012
Posts: 6
Reputation: 0
Default Re: Help in Battle Sys

Nobody can help ?
משה is offline   Reply With Quote
Old 05/04/2012, 09:50 AM   #3
Toreno
Gangsta
 
Join Date: Nov 2010
Posts: 846
Reputation: 41
Default Re: Help in Battle Sys

Once someone requests another player to do a battle, and he accepts it. You should create two variables with MAX_PLAYERS, and when the player accepts the battle. Make those two variable into 1, one for the playerid who sends request, and the other for the id, who receives request. And now you these two variables on OnPlayerDeath, to discover if someone died when he was in a battle, if he was, send client message to all. Hope you have understood what my point is.
Toreno 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
Battle Saving Screenshots and Videos 5 25/10/2009 05:23 PM
[GameMode] [GM]Battle For The Dam 0.5 Floul1 Gamemode Scripts 2 16/10/2009 07:01 AM
[Map] [MAP] Battle Ships V1ceC1ty Maps 15 06/10/2009 04:45 PM
battle _ReloadeD_ Help Archive 3 23/09/2009 08:31 PM


All times are GMT. The time now is 01:46 AM.


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