SA-MP Forums Archive
Hello Everyone! - 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: Hello Everyone! (/showthread.php?tid=574780)



Hello Everyone! - Curmei - 20.05.2015

Hy, i have a problem with spawn. As a civilian you'll spawn ok, until you take part of a team/factions or something, when i use /respawn i am respawned to the sky and falling down to de center of the SA MAP. In a town. If i go back as a civilian, i have the same problem, the unique solution is to relog.
I used already a freeze timer. but that didn't work!


Re: Hello Everyone! - kalanerik99 - 20.05.2015

Post the code And maybe I can help you !


Re: Hello Everyone! - kyriakos587 - 20.05.2015

Use SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);

to /respawn commnd


Re: Hello Everyone! - Luis- - 20.05.2015

Quote:
Originally Posted by kyriakos587
Посмотреть сообщение
Use SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);

to /respawn commnd
It doesn't sound like an interior or virtual world problem.

Could be something to do with the positions if you're using an array or something, as said above, we cannot do anything without any codes.


Re: Hello Everyone! - Curmei - 20.05.2015

Quote:

if(strcmp(cmd, "/respawn", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{D580FE}Foloseste:{FFFFFF} /respawn [playerid/PartOfName]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
if(PlayerInfo[playa][pJailed] == 1)
{
SendClientMessage(playerid,COLOR_GREY," You can`t use this command on that player because is in jail !");
return 1;
}
if(WantedLevel[playa] >= 1)
{
SendClientMessage(playerid,COLOR_GREY," You can`t use this command on that player, is currently Wanted !");
return 1;
}
if(SpawnChange[playerid])
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
SpawnPlayer(playa);
ResetPlayerWeapons(playa);
SetPlayerArmour(playa, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* You have respawned player %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "*You have been respawned by Admin{FF3300} %s.", sendername);
SendClientMessage(playa, COLOR_WHITE, string);
format(string, 128, "AdmCmd: %s has respawned the player %s ", sendername, giveplayer);
ABroadCast(COLOR_YELLOW,string,1);
HBroadCast(COLOR_YELLOW,string);
return 1;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Nu ai voie sa folosesti aceasta comanda!");
}
}
return 1;
}

but that's not happen only on cmd respawn, it's happen if i use /respawn or if i am killed..
tell me if you need onplayerdeath code..


Re: Hello Everyone! - Luis- - 20.05.2015

You're using
pawn Код:
SpawnPlayer(playa)
without using
pawn Код:
SetSpawnInfo
that's most probably why.