SA-MP Forums Archive
Player Pausing After entering derby? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Player Pausing After entering derby? (/showthread.php?tid=589586)



Player Pausing After entering derby? - karemmahmed22 - 20.09.2015

PHP код:
  if(strcmp(cmd"/derby"true) == 0)
            {
                if(
derbyplaying == 1)
                {
                    
SendClientMessage(playerid0xB4B5B7AA"The derby is already started");
                    return 
1;
                }
                if(
playerinminigame[playerid] == 1)
                {
                    
SendClientMessage(playerid0xB4B5B7AA"You are already in a minigame");
                    return 
1;
                }
                    new 
pname[256];
                    
GetPlayerName(playeridpname256);
                if(
derbyon == 0)
                {
                    
derbyon 1;
                    
playerinminigame[playerid] = 1;
                    
playerinderby[playerid] = 1;
                    
derbyrank 1;
                    
SetPlayerInterior(playerid,15);
                    
SetPlayerVirtualWorld(playerid,7);
                    
SetVehicleVirtualWorld(bloodring[0],7);
                    
bloodringfull[0] = 1;
                    
PutPlayerInVehicle(playeridbloodring[0], 0);
                    
playerinbloodring[playerid] = 0;
                    
TogglePlayerControllable(playerid0);
                    
startvar[0] = 1;
                    
dtimer SetTimer("StartDerby"600000);
                    
format(stringsizeof(string), "%s has started a derby, you have one minute to type /derby and join"pname);//
                            
SendClientMessageToAll(0x33AA33AA,string);
                            return 
1;
                } else if(
derbyon == && derbyrank 15) {
                    
playerinminigame[playerid] = 1;
                    
playerinderby[playerid] = 1;
                    
derbyrank++;
                    
SetPlayerInterior(playerid,15);
                    for(new 
i=0i<15i++)
                    {
                            if(
bloodringfull[i] == 0)
                            {
                                
SetPlayerVirtualWorld(playerid,7);
                                
SetVehicleVirtualWorld(bloodring[i],7);
                                
bloodringfull[i] = 1;
                                
PutPlayerInVehicle(playeridbloodring[i], 0);
                                
TogglePlayerControllable(playerid0);
                                
playerinbloodring[playerid] = i;
                                
format(stringsizeof(string), "%s has joined the derby"pname);//
                                            
SendClientMessageToAll(0x33AA33AA,string);
                                            return 
1;
                            }
                            }
                } else if(
derbyon == && derbyrank >= 15) {
                        
format(stringsizeof(string), "The derby is full, wait for the next round"pname);//
                        
SendClientMessage(playerid,0x33AA33AA,string);
                        return 
1;
                }
            } 
Thats my code, Sorry for indentation, I got it from forums from pastebin, it fucked up the indent.
However, When every i use /derby command, i go to VW 7, Interior 15, with car.
But when another player do same, so they should join with me, They gets near my car, but paused
like,They pressed ESC.
I checked Virtual worlds, They're same.
I will explain what exactly happens
When i do /derby, It announces to other players.
When someone do /derby, I see his car near mine, and he's standing above the car pausing, But in fact, He see me pausing too, What causes this?


Re: Player Pausing After entering derby? - Mister0 - 20.09.2015

Most important you have this PutPlayerInVehicle(playerid, bloodring[i], 0); maibe you don't have the vehicle with playerid
Check the server_log or mysql_log maybe give run time rror or someone else...


Re: Player Pausing After entering derby? - jlalt - 20.09.2015

do you have public onplayerupdate? if yes can i see it?


Re: Player Pausing After entering derby? - karemmahmed22 - 20.09.2015

Ohhhhhh, Thanks for help, I was denying weapons on interiors in my gamemode so, it was desynced ppls who got weapons
Thanks for help btw, Repped.


Re: Player Pausing After entering derby? - jlalt - 20.09.2015

Quote:
Originally Posted by karemmahmed22
Посмотреть сообщение
Ohhhhhh, Thanks for help, I was denying weapons on interiors in my gamemode so, it was desynced ppls who got weapons
Thanks for help btw, Repped.
glad to help you


Re: Player Pausing After entering derby? - karemmahmed22 - 20.09.2015

Ehm, Even after i resetted player weapons, Players still pauses :/
especially at those commands tping to another VW/Interior (Derby/Race)
PHP код:
           
            
if(strcmp(cmd"/kartrace"true) == 0)
            {
                if(
kartplaying == 1)
                {
                    
SendClientMessage(playerid0xB4B5B7AA"The kart race is already started");
                    return 
1;
                }
                if(
playerinminigame[playerid] == 1)
                {
                    
SendClientMessage(playerid0xB4B5B7AA"You are already in a minigame");
                    return 
1;
                }
                    new 
pname[256];
                    
GetPlayerName(playeridpname256);
                if(
karton == 0)
                {
                
                    
karton 1;
                    
playerinminigame[playerid] = 1;
                    
playerinkartrace[playerid] = 1;
                    
kartrank 1;
                    
krtfirst 1;
                    
currentcheckpoint[playerid] = 0;
                    
SetPlayerInterior(playerid,15);
                    
SetPlayerVirtualWorld(playerid,7);
                    
SetVehicleVirtualWorld(karts[0],7);
                    
kartfull[0] = 1;
                    
PutPlayerInVehicle(playeridkarts[0], 0);
                    
playerinkart[playerid] = 0;
                    
TogglePlayerControllable(playerid0);
                    
SetPlayerRaceCheckpoint(playerid,0,kcps[0][0],kcps[0][1],kcps[0][2],kcps[1][0],kcps[1][1],kcps[1][2],20);
                    
startvar[6] = 1;
                    
krttimer SetTimer("StartKart"600000);
                    
                    
format(stringsizeof(string), "%s has started a kart race, you have one minute to type /kartrace and join"pname);//
                            
SendClientMessageToAll(0x33AA33AA,string);
                        
ResetPlayerWeapons(playerid);
                            return 
1;
                } else if(
karton == && kartrank 15) {
                    
playerinminigame[playerid] = 1;
                    
playerinkartrace[playerid] = 1;
                    
kartrank++;
                    
currentcheckpoint[playerid] = 0;
                    
SetPlayerInterior(playerid,15);
                    for(new 
i=0i<15i++)
                    {
                            if(
kartfull[i] == 0)
                            {
                                
ResetPlayerWeapons(playerid);
                                
SetPlayerVirtualWorld(playerid,7);
                                
SetVehicleVirtualWorld(karts[i],7);
                                
kartfull[i] = 1;
                                
PutPlayerInVehicle(playeridkarts[i], 0);
                                
TogglePlayerControllable(playerid0);
                                
SetPlayerRaceCheckpoint(playerid,0,kcps[0][0],kcps[0][1],kcps[0][2],kcps[1][0],kcps[1][1],kcps[1][2],20);
                                
playerinkart[playerid] = i;
                                
format(stringsizeof(string), "%s has joined the kart race"pname);//
                                            
SendClientMessageToAll(0x33AA33AA,string);
                                            return 
1;
                            }
                            }
                } else if(
karton == && kartrank >= 15) {
                        
format(stringsizeof(string), "The kart race is full, wait for the next round"pname);//
                        
SendClientMessage(playerid,0x33AA33AA,string);
                        return 
1;
                }
            }
           
            if(
strcmp(cmd"/srace"true) == 0)
            {
                if(
srplaying == 1)
                {
                    
SendClientMessage(playerid0xB4B5B7AA"The stadium race is already started");
                    return 
1;
                }
                if(
playerinminigame[playerid] == 1)
                {
                    
SendClientMessage(playerid0xB4B5B7AA"You are already in a minigame");
                    return 
1;
                }
                    new 
pname[256];
                    
GetPlayerName(playeridpname256);
                if(
sron == 0)
                {
                    
sron 1;
                    
playerinminigame[playerid] = 1;
                    
playerinsr[playerid] = 1;
                    
srrank 1;
                    
srfirst 1;
                    
currentracecheckpoint[playerid] = 0;
                    
SetPlayerInterior(playerid,4);
                    
SetPlayerVirtualWorld(playerid,7);
                    
SetVehicleVirtualWorld(nrg[0],7);
                    
nrgfull[0] = 1;
                    
PutPlayerInVehicle(playeridnrg[0], 0);
                    
playerinnrg[playerid] = 0;
                    
TogglePlayerControllable(playerid0);
                    
SetPlayerRaceCheckpoint(playerid,0,srcps[0][0],srcps[0][1],srcps[0][2],srcps[1][0],srcps[1][1],srcps[1][2],10);
                    
startvar[7] = 1;
                    
srtimer SetTimer("StartSr"600000);
                    
format(stringsizeof(string), "%s has started a stadium race, you have one minute to type /srace and join"pname);//
                            
SendClientMessageToAll(0x33AA33AA,string);
                                                
ResetPlayerWeapons(playerid);
                            return 
1;
                } else if(
sron == && srrank 15) {
                    
playerinminigame[playerid] = 1;
                    
playerinsr[playerid] = 1;
                    
srrank++;
                    
currentracecheckpoint[playerid] = 0;
                    
SetPlayerInterior(playerid,4);
                    for(new 
i=0i<15i++)
                    {
                            if(
nrgfull[i] == 0)
                            {
                                                
ResetPlayerWeapons(playerid);
                                
SetPlayerVirtualWorld(playerid,7);
                                
SetVehicleVirtualWorld(nrg[i],7);
                                
nrgfull[i] = 1;
                                
PutPlayerInVehicle(playeridnrg[i], 0);
                                
TogglePlayerControllable(playerid0);
                                
SetPlayerRaceCheckpoint(playerid,0,srcps[0][0],srcps[0][1],srcps[0][2],srcps[1][0],srcps[1][1],srcps[1][2],10);
                                
playerinnrg[playerid] = i;
                                
format(stringsizeof(string), "%s has joined the stadium race"pname);//
                                            
SendClientMessageToAll(0x33AA33AA,string);
                                            return 
1;
                            }
                            }
                } else if(
sron == && srrank >= 15) {
                        
format(stringsizeof(string), "The stadium race is full, wait for the next round"pname);//
                        
SendClientMessage(playerid,0x33AA33AA,string);
                        return 
1;
                }
            } 



Re: Player Pausing After entering derby? - jlalt - 20.09.2015

well, there are
PHP код:
TogglePlayerControllable(playerid0); 
would it make the problem? or it being 1 later? if not try to remove / replace it with :
Код:
TogglePlayerControllable(playerid, 1);



Re: Player Pausing After entering derby? - karemmahmed22 - 20.09.2015

Nah, It unfreezes the player already, But still player pauses.