CMD doesn't work
#1

PHP код:
CMD:qdm(playeridparams[])
{
if(
pInfo[playerid][CBDM] == 0) return SendClientMessage(playerid,COLOR_RED,"You're not in any deathmatch!");
if(
pInfo[playerid][LEADER] == 1)
{
SpawnPlayer(playerid);
SetPlayerPos(playerid,2511.5886,-1665.9419,13.5726);
SetPlayerSkin(playerid,137);
SendClientMessage(playeridCOLOR_RED"You Left Cbug Deathmatch!");
pInfo[playerid][CBDM] = 0;
}
if(
pInfo[playerid][COLEADER] == 1)
{
SpawnPlayer(playerid);
SetPlayerPos(playerid,2317.3718,-1650.7227,14.2248);
SetPlayerSkin(playerid,230);
SendClientMessage(playeridCOLOR_RED"You Left Cbug Deathmatch!");
pInfo[playerid][CBDM] = 0;
}
if(
pInfo[playerid][ELDER] == 1)
{
SpawnPlayer(playerid);
SetPlayerPos(playerid,2511.5886,-1665.9419,13.5726);
SetPlayerSkin(playerid,134);
SendClientMessage(playeridCOLOR_RED"You Left Cbug Deathmatch!");
pInfo[playerid][CBDM] = 0;
}
return 
1;

This is my code.The problem is this
PHP код:
SetPlayerPos 
teleport me to a weird place.I got this coordinate from
PHP код:
OnPlayerSpawn 
and its work.But when use this cmd,its take me to a wrong place.

BTW the post should be 'SetPlayerPos doesn't work'.Sorry
Reply
#2

Show me : SpawnPlayer public
Reply
#3

Are you using SpawnPlayer as a stock?
Reply
#4

You must have gotten the wrong coordinates. Go in game and type /save to save the coordinates.
Goto My documents > GTA San Andreas User Files > SAMP > savedpositions.txt
Reply
#5

Im not using spawn player as a stock.And the coordinate works on code below.
Here is the code :
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
if(
dialogid == 1212)//This is the ID of the Dialog
{
if(!
response)
{
ShowPlayerDialog(playerid1212DIALOG_STYLE_LIST"Choose Your Rank""{241ED6}Leader\n{DEE612}Co Leader\n{0FBD0F}Elder""Choose""Close");
}
if(
response)
{
if(
listitem == 0//Leader
{
SpawnPlayer(playerid);
SetPlayerPos(playerid,1574.9681,-1635.9956,13.5509); // LSPD
SetPlayerSkin(playerid,137);
SendClientMessage(playeridCOLOR_BLUE"Welcome [SoD] Leader");
GameTextForPlayer(playerid,"*Welcome To "#SERVERNAME"*",3000,3);
pInfo[playerid][LEADER] = 1;
}
if(
listitem == 1)//Co Leader
{
SpawnPlayer(playerid);
SetPlayerPos(playerid,2317.3718,-1650.7227,14.2248); // Biker
SetPlayerSkin(playerid,230);
SendClientMessage(playeridCOLOR_YELLOW"Welcome [SoD] Co Leader !");
GameTextForPlayer(playerid,"*Welcome To "#SERVERNAME"*",3000,3);
pInfo[playerid][COLEADER] = 1;
}
if(
listitem == 2)//Elder
{
SpawnPlayer(playerid);
SetPlayerPos(playerid,2511.5886,-1665.9419,13.5726); // Groove Street
SetPlayerSkin(playerid,134);
SendClientMessage(playeridCOLOR_BLUE"Welcome [SoD] Elder");
GameTextForPlayer(playerid,"*Welcome To "#SERVERNAME"*",3000,3);
pInfo[playerid][ELDER] = 1;
}
}
}
return 
1;

Sorry but the coordinate get from above code not
PHP код:
OnPlayerSpawn 
Reply
#6

Show the fonction SpawnPlayer
Reply
#7

function SpawnPlayer?
Its just spawn a player right? Click here
Reply
#8

Anyone?
Reply
#9

Are you sure the SetPlayerPos coords are right?
Reply
#10

Yes dude.I know its right.Its the same coord of the first spawn.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)