SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 06/08/2017, 08:59 AM   #1
asri
Big Clucker
 
Join Date: May 2017
Location: Malaysia
Posts: 151
Reputation: 2
Default bug

when enter deathmatch the Interior is blank and then the player money
Ascending slightly when enter the room.

PHP Code:
public OnPlayerSpawn(PID
PHP Code:
if(InDM[PID] == true)
              {
                  switch (
DM[PID])
                {
                    case 
0shamal
                    
{
                            
GivePlayerWeapon(PID241000);
                            
SetPlayerHealth(PID99);
                            
SetPlayerArmour(PID99);
                            new 
spawn random(sizeof(DMZeroSpawns));
                            
SetPlayerPos(PIDDMZeroSpawns[spawn][0], DMZeroSpawns[spawn][1], DMZeroSpawns[spawn][2]);
                            
SetPlayerFacingAngle(PIDDMZeroSpawns[spawn][3]); //>> SetPlayerInterior
                            
SetPlayerVirtualWorld(PID1);
                            
SetPlayerInterior(playerid17);
                            
SetPlayerHealth(PID99);
                    }
                }
              } 
PHP Code:
public OnPlayerDeath(PIDkilleridreason
PHP Code:
if(InDM[PID] == true)
            {
              if(
anakko[PID] == 1)
              {
                    
anakko[PID] = 0;
                     if(
makko[PID] != INVALID_PLAYER_ID)
                    
TogglePlayerSpectating(PID1);
                    
PlayerSpectatePlayer(PIDkillerid);
                    
SendClientMessage(PIDSKYBLUE    "You have been killed, you are now spectating your killer.");
                    
SetTimerEx("EndDeathCam"10000false"i"playerid);
              }
              else
              {
                    
TogglePlayerSpectating(PID0);
                    
killstreak(PIDkillerid);
                    
DestroyDynamic3DTextLabel(wanted[killerid]);
                    return 
1;
              }
            } 
the dialog
PHP Code:
Dialog:RandomDM(PIDresponselistiteminputtext[])
{
    new 
string[128], playerName[MAX_PLAYER_NAME];
    
GetPlayerName(PIDplayerNamesizeof(playerName));
    if (
response)
    {
        switch(
listitem// Check which option was chosen when they responded. We only have one for now. The next would be case 1, then case 2 and so on.
        
{
            case 
0:
            {
                    
InDM[PID] = true;
                    
DM[PID] = 0;
                    
SpawnPlayer(PID);
                    
PlayerTextDrawHide(PID,Textdraw0);
                    
PlayerTextDrawHide(PID,Textdraw1);
                    
PlayerTextDrawHide(PID,Textdraw2);
                    
PlayerTextDrawHide(PID,Textdraw3);
                    
SetPlayerInterior(playerid17);
                    
SetPlayerVirtualWorld(PID1);
            }
        }
        
format(stringsizeof(string), "{77B3D9}[DM Zones] {ffffff}%s(%i) has just entered {77B3D9}DM zone %i {ffffff}(/dm)"playerNamePIDDM[PID]);
        
scms(-1string);
        return 
1;  // ?? One you missed
    
}
    return 
0;

the command
PHP Code:
CMD:dmlist(PIDparams[])
{
    
Dialog_Show(PIDRandomDMDIALOG_STYLE_LIST"DM Zones""DM 0 - Shamal""Enter""Cancel");
    return 
1;

another question,how make limit of room example if the maximum of room is 5 and other player cant go in
asri is offline   Reply With Quote
Old 06/08/2017, 11:38 AM   #2
asri
Big Clucker
 
Join Date: May 2017
Location: Malaysia
Posts: 151
Reputation: 2
Default Re: bug

update

the console show this

Quote:
[18:18:17] BUD::MultiGet returned:
money: 7450
kills: 0
deaths: 0
res: 0
[18:19:52] [debug] Run time error 4: "Array index out of bounds"
[18:19:52] [debug] Attempted to read/write array element at index 65535 in array of size 100
[18:19:52] [debug] AMX backtrace:
[18:19:52] [debug] #0 0003fcb0 in ?? (0, 65535) from a.amx
[18:19:52] [debug] #1 0003f52c in public WC_OnPlayerDeath (0, 65535, 55) from a.amx
[18:19:52] [debug] #2 00015f18 in ?? (0, 0, 65535, 55, 0, 0) from a.amx
[18:19:52] [debug] #3 0000196c in ?? (0, 0, -1082130432) from a.amx
[18:19:52] [debug] #4 00044eb0 in public cmd_kills (0, 6149920) from a.amx
[18:19:52] [debug] #5 native CallLocalFunction () from samp-server.exe
[18:19:52] [debug] #6 00000710 in public OnPlayerCommandText (0, 6149892) from a.amx
asri is offline   Reply With Quote
Old 06/08/2017, 11:42 AM   #3
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,448
Reputation: 515
Default Re: bug

Wrap this:
Code:
killstreak(PID, killerid); 
DestroyDynamic3DTextLabel(wanted[killerid]);
in check if killerid != invalid player id
Misiur is offline   Reply With Quote
Old 06/08/2017, 11:51 AM   #4
asri
Big Clucker
 
Join Date: May 2017
Location: Malaysia
Posts: 151
Reputation: 2
Default Re: bug

you do you mean

update:

the compiler show this

Quote:
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase

Header size: 9848 bytes
Code size: 356672 bytes
Data size: 6149596 bytes
Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements: 6532500 bytes
asri is offline   Reply With Quote
Old 07/08/2017, 04:03 AM   #5
asri
Big Clucker
 
Join Date: May 2017
Location: Malaysia
Posts: 151
Reputation: 2
Default Re: bug

help
asri is offline   Reply With Quote
Old 07/08/2017, 02:57 PM   #6
asri
Big Clucker
 
Join Date: May 2017
Location: Malaysia
Posts: 151
Reputation: 2
Default Re: bug

help
asri is offline   Reply With Quote
Old 08/08/2017, 01:18 AM   #7
asri
Big Clucker
 
Join Date: May 2017
Location: Malaysia
Posts: 151
Reputation: 2
Default Re: bug

Help.when i type kill command it show the crash console
asri is offline   Reply With Quote
Old 08/08/2017, 01:37 AM   #8
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,440
Reputation: 120
Default Re: bug

Quote:
Originally Posted by asri View Post
you do you mean

update:

the compiler show this
This is not related to the crash, I guess.
Show your logs please and have you updated your code since the Misiur's answer ?
__________________
What matters isn't to going further, it's the way to get there
Dayrion is offline   Reply With Quote
Old 08/08/2017, 02:38 AM   #9
asri
Big Clucker
 
Join Date: May 2017
Location: Malaysia
Posts: 151
Reputation: 2
Default Re: bug

you mean onplayerdeath.yes i update the code
asri is offline   Reply With Quote
Old 08/08/2017, 01:55 PM   #10
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,440
Reputation: 120
Default Re: bug

Let's show us your logs
__________________
What matters isn't to going further, it's the way to get there
Dayrion 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



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


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