SA-MP Forums Archive
Problem in script Help will get reward - 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: Problem in script Help will get reward (/showthread.php?tid=353995)

Pages: 1 2


Problem in script Help will get reward - jaami - 25.06.2012

This script is prefect but having this problem when spawning after login and register

Anyone knows why. I didnot even edit the gravity, The interior was set to 0 and the spawn coor is in LS. So any have the solution. Please help and you will get reward. Not rep but a good reward.


Re: Problem in script Help will get reward - Hawky133 - 25.06.2012

Hello.

I remember having this problem before, but I can't remember the exact cause (or if only one problem causes this).

You can either post the code for your "OnPlayerSpawn" callback, or debug it by commenting out all the contents, and seeing if this fixes the problem.
e.g.
pawn Код:
public OnPlayerSpawn(playerid){
    this code will get called
    /*
    This code will not get called
    */

}



Re: Problem in script Help will get reward - M3mPHi$_S3 - 25.06.2012

re-install gta san andreas !!!


Re: Problem in script Help will get reward - Neil. - 25.06.2012

Experienced this one before, make sure you have the following on the OnGameModeInit callback

PHP код:
//This are just samples
AddPlayerClass(266,-83.7954,1378.8971,10.2734,278.6383,0,0,0,0,0,0);
AddPlayerClass(61,-83.7954,1378.8971,10.2734,278.6383,0,0,0,0,0,0);
AddPlayerClass(240,-83.7954,1378.8971,10.2734,278.6383,0,0,0,0,0,0); 
I noticed that when you do not include those (Tried using the dialogs and not putting even 1 AddPlayerClass Function on the callback, and it responded the same way as yours), and I tried adding the function again and it worked


Re: Problem in script Help will get reward - jaami - 25.06.2012

Well
Here is the code
Quote:

public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "Zombie_1", true))
{
SetPlayerSkin(playerid, 162);
SetPlayerPos(playerid, 1776.4562,-1895.7217,13.3867);
TogglePlayerControllable(playerid, true);
SetPlayerColor(playerid, BLANCO2);
gTeam[playerid] = ZOMBIE;
}
if(!strcmp(npcname, "Zombie_2", true))
{
SetPlayerSkin(playerid, 162);
SetPlayerPos(playerid, 1507.4354,-1730.9388,13.382;
TogglePlayerControllable(playerid, true);
SetPlayerColor(playerid, BLANCO2);
gTeam[playerid] = ZOMBIE;
}
if(!strcmp(npcname, "Zombie_3", true))
{
SetPlayerSkin(playerid, 162);
SetPlayerPos(playerid, 1776.4562,-1895.7217,13.3867);
TogglePlayerControllable(playerid, true);
SetPlayerColor(playerid, BLANCO2);
gTeam[playerid] = ZOMBIE;
}
if(!strcmp(npcname,"Bot_intro",true))
{
PutPlayerInVehicle(playerid,63, 0);
new coche = GetPlayerVehicleID(playerid);
SetVehicleParamsEx(coche, 1, 0, -1, 0, 0, 0, 0);
TogglePlayerControllable(playerid, true);
SetPlayerColor(playerid, BLANCO2);
gTeam[playerid] = HUMAN;
}
else
{
new which_spawn = random(4);
switch(which_spawn)
{
case 0:
{
SetPlayerSkin(playerid, 162);
SetPlayerPos(playerid,1138.4512,-1385.9067,13.7797);
SetPlayerInterior(playerid,0);
TogglePlayerControllable(playerid, true);
}
case 1:
{
SetPlayerSkin(playerid, 162);
SetPlayerPos(playerid,1543.7426,-1305.9878,16.1152);
SetPlayerInterior(playerid,0);
TogglePlayerControllable(playerid, true);
}
case 2:
{
SetPlayerSkin(playerid, 162);
SetPlayerPos(playerid,2578.9900,-1412.2079,24.461;
SetPlayerInterior(playerid,0);
TogglePlayerControllable(playerid, true);
}
case 3:
{
SetPlayerSkin(playerid, 162);
SetPlayerPos(playerid,2578.9900,-1412.2079,24.461;
SetPlayerInterior(playerid,0);
TogglePlayerControllable(playerid, true);
}
}
}
return 1;
}
/* */
GangZoneShowForPlayer(playerid, GangLavaAutos, BLANCO2);
GangZoneShowForPlayer(playerid, GangProstibulo, BLANCO2);
GangZoneShowForPlayer(playerid, GangGroveMuerta, BLANCO2);
GangZoneShowForPlayer(playerid, GangZombiesBajos, BLANCO2);
GangZoneShowForPlayer(playerid, GangViejoMotel, BLANCO2);
GangZoneShowForPlayer(playerid, GangGlenMuerte, BLANCO2);
GangZoneShowForPlayer(playerid, GangSkatePark, BLANCO2);
GangZoneShowForPlayer(playerid, GangMedicinaZombie, BLANCO2);
GangZoneShowForPlayer(playerid, Gangidlewood1, BLANCO2);
GangZoneShowForPlayer(playerid, gangidlewood2, BLANCO2);
GangZoneShowForPlayer(playerid, Gangidlewood3, BLANCO2);
GangZoneShowForPlayer(playerid, GangUnity, BLANCO2);
GangZoneShowForPlayer(playerid, GangCoronaCaida, BLANCO2);
GangZoneShowForPlayer(playerid, GangComisarialoscaidos, BLANCO2);
GangZoneShowForPlayer(playerid, GangZonaConspir, BLANCO2);
GangZoneShowForPlayer(playerid, GangVinewood, BLANCO2);
GangZoneShowForPlayer(playerid, GangNatural, BLANCO2);
GangZoneShowForPlayer(playerid, GangNoNatural, BLANCO2);
GangZoneShowForPlayer(playerid, GangSantoMuertoBeach, BLANCO2);
GangZoneShowForPlayer(playerid, GangPuntoMuerto, BLANCO2);
TextDrawShowForPlayer(playerid, Condition[playerid]);
TextDrawShowForPlayer(playerid, Zones[playerid]);
TextDrawShowForPlayer(playerid, Zones2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
if(IsPlayerAttachedObjectSlotUsed(playerid, 0)) RemovePlayerAttachedObject(playerid, 0);
if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) RemovePlayerAttachedObject(playerid, 1);
if(IsPlayerAttachedObjectSlotUsed(playerid, 2)) RemovePlayerAttachedObject(playerid, 2);
if(IsPlayerAttachedObjectSlotUsed(playerid, 3)) RemovePlayerAttachedObject(playerid, 3);
if(IsPlayerAttachedObjectSlotUsed(playerid, 4)) RemovePlayerAttachedObject(playerid, 4);
if(IsPlayerAttachedObjectSlotUsed(playerid, 5)) RemovePlayerAttachedObject(playerid, 5);
RemovePlayerAttachedObject(playerid,0);
PlayerInfo[playerid][jZombieC] = 1;
LPuestos[playerid] = 0;
GPuesto[playerid] = 0;
ConTexto[playerid] = 0;
AntiDeAMX();
/* */

/*TextDrawShowForPlayer(playerid,Dinero[playerid]);*/
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
if (realtime)
{
SetWorldTime(tmphour);
}
PlayerPlaySound(playerid, 1069, 0.0, 0.0, 0.0);
SetPlayerDrunkLevel(playerid, 0);
if(PlayerInfo[playerid][jEstiloPelea] == 1)
{
SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
}
else if(PlayerInfo[playerid][jEstiloPelea] == 2)
{
SetPlayerFightingStyle(playerid, FIGHT_STYLE_KNEEHEAD);
}
else if(PlayerInfo[playerid][jEstiloPelea] == 3)
{
SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU);
}
if(PlayerInfo[playerid][jArma] != 0)
{
GivePlayerWeapon(playerid, PlayerInfo[playerid][jArma], PlayerInfo[playerid][jMunicion]);
}
if(PlayerInfo[playerid][jArma2] != 0)
{
GivePlayerWeapon(playerid, PlayerInfo[playerid][jArma2], PlayerInfo[playerid][jMunicion2]);
}
if(PlayerInfo[playerid][jArma3] != 0)
{
GivePlayerWeapon(playerid, PlayerInfo[playerid][jArma3], PlayerInfo[playerid][jMunicion3]);
}
if(PlayerInfo[playerid][jSpawn] == 1)
{
new which_spawn = random(4);
if(which_spawn == 0)
{
if(gTeam[playerid] == HUMAN)
{
SetPlayerPos(playerid,815.0766,-1094.3162,25.7895);
SetPlayerInterior(playerid,0);
SetPlayerWeather(playerid,ClimaDefault);
SetPlayerSkin(playerid,PlayerInfo[playerid][jRopa]);
}
else if(gTeam[playerid] == ZOMBIE)
{
SetPlayerPos(playerid,1138.4512,-1385.9067,13.7797);
SetPlayerInterior(playerid,0);
SetPlayerWeather(playerid, ClimaDefault);
new rnd = random(sizeof(ZombieSkin));
SetPlayerSkin(playerid, ZombieSkin[rnd][0]);
}
}
else if(which_spawn == 1)
{
if(gTeam[playerid] == HUMAN)
{
SetPlayerPos(playerid,1134.1107,-1488.0193,22.7690);
SetPlayerInterior(playerid,0);
SetPlayerWeather(playerid, ClimaDefault);
SetPlayerSkin(playerid,PlayerInfo[playerid][jRopa]);
}
else if(gTeam[playerid] == ZOMBIE)
{
SetPlayerPos(playerid,1543.7426,-1305.9878,16.1152);
SetPlayerInterior(playerid,0);
SetPlayerWeather(playerid, ClimaDefault);
new rnd = random(sizeof(ZombieSkin));
SetPlayerSkin(playerid, ZombieSkin[rnd][0]);
}
}
else if(which_spawn == 2)
{
if(gTeam[playerid] == HUMAN)
{
SetPlayerPos(playerid,2509.9282,-1472.3695,24.0294);
SetPlayerInterior(playerid,0);
SetPlayerWeather(playerid, ClimaDefault);
SetPlayerSkin(playerid,PlayerInfo[playerid][jRopa]);
}
else if(gTeam[playerid] == ZOMBIE)
{
SetPlayerPos(playerid,2578.9900,-1412.2079,24.461;
SetPlayerInterior(playerid,0);
SetPlayerWeather(playerid, ClimaDefault);
new rnd = random(sizeof(ZombieSkin));
SetPlayerSkin(playerid, ZombieSkin[rnd][0]);
}
}
else if(which_spawn == 3)
{
if(gTeam[playerid] == HUMAN)
{
SetPlayerPos(playerid,1593.0189,-1203.7548,19.8659);
SetPlayerInterior(playerid,0);
SetPlayerWeather(playerid, ClimaDefault);
SetPlayerSkin(playerid,PlayerInfo[playerid][jRopa]);
}
else if(gTeam[playerid] == ZOMBIE)
{
SetPlayerPos(playerid,2578.9900,-1412.2079,24.461;
SetPlayerInterior(playerid,0);
SetPlayerWeather(playerid, ClimaDefault);
new rnd = random(sizeof(ZombieSkin));
SetPlayerSkin(playerid, ZombieSkin[rnd][0]);
}
}
if(PlayerInfo[playerid][jInfected] >= 1)
{
SafeSetPlayerPos(playerid,PlayerInfo[playerid][jPos_x],PlayerInfo[playerid][jPos_y],PlayerInfo[playerid][jPos_z]);
ZombieTeam(playerid);
new rnd = random(sizeof(ZombieSkin));
SetPlayerSkin(playerid, ZombieSkin[rnd][0]);
PlayerInfo[playerid][jInfected] = 0;
PlayerInfo[playerid][jZombie] = 1;
TogglePlayerControllable(playerid, 1);
}
else if(PlayerInfo[playerid][jInfected] == 0 && PlayerInfo[playerid][jZombie] == 0)
{
SafeSetPlayerPos(playerid,PlayerInfo[playerid][jPos_x],PlayerInfo[playerid][jPos_y],PlayerInfo[playerid][jPos_z]);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
SetPlayerSkin(playerid, PlayerInfo[playerid][jRopa]);
SetTimerEx("Desmayar", 2000, 0, "d", playerid);
}
/*else if(PlayerInfo[playerid][jLider] == 1)
{
SetPlayerPos(playerid,225.6344,1909.2631,17.6406);
Militar(playerid);
}
else if(PlayerInfo[playerid][jLider] == 2)
{
TogglePlayerControllable(playerid,0);
SetTimerEx("Desfrizear", 6000, 0, "d", playerid);
SetPlayerPos(playerid,1833.8231,-1299.1377,22.2039);
Conspirador(playerid);
}
else if(PlayerInfo[playerid][jMiembro] == 3)
{
SetPlayerPos(playerid,2759.2126,-2436.4126,13.5050);
Militar(playerid);
}
else if(PlayerInfo[playerid][jMiembro] == 2)
{
TogglePlayerControllable(playerid,0);
SetTimerEx("Desfrizear", 6000, 0, "d", playerid);
SetPlayerPos(playerid,1833.8231,-1299.1377,22.2039);
Conspirador(playerid);
}
else if(PlayerInfo[playerid][jMiembro] == 1)
{
SetPlayerPos(playerid,110.2537,1901.6782,10.0955);
Militar(playerid);
}*/
}
else if(PlayerInfo[playerid][jSpawn] == 0)
{
if(PlayerInfo[playerid][jEncarcelado] == 0)
{
SafeSetPlayerInterior(playerid,PlayerInfo[playerid][jInt]);
SafeSetPlayerPos(playerid,PlayerInfo[playerid][jPos_x],PlayerInfo[playerid][jPos_y],PlayerInfo[playerid][jPos_z]);
SetPlayerHealth(playerid,PlayerInfo[playerid][jVida]);
SetPlayerSkin(playerid,PlayerInfo[playerid][jRopa]);
SetPlayerArmour(playerid,PlayerInfo[playerid][jArmadura]);
TogglePlayerControllable(playerid, 1);
PlayerInfo[playerid][jSpawn] = 1;
return 1;
}
else if(PlayerInfo[playerid][jEncarcelado] >= 1)
{
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, 2448.2351,-1977.7130,13.593;
SendClientMessage(playerid, ROJO_OSCURO, "Tu condena no ha terminado!.");
SetPlayerSkin(playerid,PlayerInfo[playerid][jRopa]);
return 1;
}
}
return 1;
}

I will pay the person 3 usd if he can fixed it.


Re: Problem in script Help will get reward - Djole1337 - 25.06.2012

You fucked up something... Check coordinates!


Re: Problem in script Help will get reward - Elysian` - 25.06.2012

Add this under OnGameModeInit, EX:
Код:
public OnGameModeInit()
{
      AddPlayerClass(266,-83.7954,1378.8971,10.2734,278.6383,0,0,0,0,0,0); 
}



Re: Problem in script Help will get reward - iggy1 - 25.06.2012

This happens to me when i use MYSQL plugin (dll) r6 with a script that is compiled with the R7 include.

If none of the above helps, make sure your script is compiled with the correct plugin includes. Also make sure you have the correct plugin files.

It's a good idea to load the nativechecker and crashdetect plugins as they should help you in some way. (hopefully)

If you look on the server browser, i bet it doesn't have your mode name on it.


Re: Problem in script Help will get reward - jaami - 25.06.2012

Quote:
Originally Posted by Windows32
Посмотреть сообщение
Add this under OnGameModeInit, EX:
Код:
public OnGameModeInit()
{
      AddPlayerClass(266,-83.7954,1378.8971,10.2734,278.6383,0,0,0,0,0,0); 
}
I did what you ask, i got 24 error..


Re: Problem in script Help will get reward - iggy1 - 25.06.2012

It's not because you have no classes, the following mode will still spawn you as cj at 0.0, 0.0, 0.0.

pawn Код:
#include <a_samp>

main()
{
}

public OnGameModeInit()
{
    return 1;
}

public OnGameModeExit()
{
    return 1;
}
Have you tried using the plugins i suggested?


Re: Problem in script Help will get reward - jaami - 25.06.2012

iggy1 is hard to chat like this, maybe you can add me at skype then we talk more nicer. add me at i.dugo


Re: Problem in script Help will get reward - iggy1 - 25.06.2012

I don't have or use skype i would need to register an account sorry.

Download these plugins.

https://sampforum.blast.hk/showthread.php?tid=249226 NOTE: native checker must be the last plugin loaded.
https://sampforum.blast.hk/showthread.php?tid=262796

After you have downloaded and installed these plugins, load your mode. Then take a look at the server log.

I still think you have plugin includes mixed up. I suggest you update all of your plugins and make sure you also update all of the includes.


Re: Problem in script Help will get reward - jaami - 25.06.2012

when i load the server everything is prefect, only when login and register, when player spawning.


Re: Problem in script Help will get reward - [MM]RoXoR[FS] - 25.06.2012

Quote:
Originally Posted by iggy1
Посмотреть сообщение
It's not because you have no classes, the following mode will still spawn you as cj at 0.0, 0.0, 0.0.

pawn Код:
#include <a_samp>

main()
{
}

public OnGameModeInit()
{
    return 1;
}

public OnGameModeExit()
{
    return 1;
}
Have you tried using the plugins i suggested?
It will give out of world boundry.


Re: Problem in script Help will get reward - iggy1 - 25.06.2012

Quote:
Originally Posted by [MM]RoXoR[FS]
Посмотреть сообщение
It will give out of world boundry.
Test it before you say that. I have tested several times and what you say does not happen. You get spawned as CJ near the farm at the center of the map.


Re: Problem in script Help will get reward - jaami - 25.06.2012

here serverlog
Quote:

SA-MP Dedicated Server
----------------------
v0.3e, ©2005-2012 SA-MP Team

[22:26:55] password = "" (string)
[22:26:55]
[22:26:55] Server Plugins
[22:26:55] --------------
[22:26:55] Loading plugin: streamer
[22:26:55]

*** Streamer Plugin v2.6.1 by Incognito loaded ***

[22:26:55] Loaded.
[22:26:55] Loading plugin: nativechecker
[22:26:55] Loaded.
[22:26:55] Loaded 2 plugins.

[22:26:55]
[22:26:55] Filterscripts
[22:26:55] ---------------
[22:26:55] Loading filterscript 'npc_record.amx'...
[22:26:56] Loaded 1 filterscripts.

[22:26:56] Still Alive - Zombie Roleplay por foogy CARGADO
[22:26:56] Number of vehicle models: 44
[22:27:34] Incoming connection: 27.104.17.23:51679
[22:27:34] [join] Idk_Idk has joined the server (0:27.104.17.23)
[22:28:09] Idk_Idk se logeу.
[22:28:24] [part] Idk_Idk has left the server (0:1)




Re: Problem in script Help will get reward - Littlehelper - 25.06.2012

Quote:
Originally Posted by [MM]RoXoR[FS]
Посмотреть сообщение
It will give out of world boundry.
No, you will spawn in the center of the map in country side.


Re: Problem in script Help will get reward - iggy1 - 25.06.2012

I don't see crashdetect plugin loaded in your log.


Re: Problem in script Help will get reward - jaami - 25.06.2012

Quote:
Originally Posted by iggy1
Посмотреть сообщение
I don't see crashdetect plugin loaded in your log.
Thats why, my script is having this world boundires bug, not plugins.. it was on 0.3d when i update it to 0.3e. it was bug on 0.3d too.. i tried to fix couple of time, Anyone can help me. im in need...


Re: Problem in script Help will get reward - Littlehelper - 25.06.2012

Quote:
Originally Posted by iggy1
Посмотреть сообщение
I don't see crashdetect plugin loaded in your log.
And i don't see any use of Crashdetect here, since it does not crash.