[Help] Dm spawn codding.
#1

Ex : I died in /Dm1. I want to respawn in /dm1. And I written this codes :

First


Код:
new PlayerInfo[MAX_PLAYERS][pInfo];
Код:
enum pInfo
{
  Area,
};
OnPlayerConnect
Код:
PlayerInfo[playerid][Area] = 0;
OnPlayerCommandText
Код:
if(!strcmp(cmdtext,"/dm1",true)) {
PlayerInfo[playerid][Area] = 1;
SetPlayerPos(playerid, 1653.2175,2409.2781,10.9262);
return 1;
}
-------OnPlayerDeath---------
Код:
if(PlayerInfo[playerid][Area] == 1)
{
SendClientMessage(playerid, COLOR_GREEN, "[Dm-1]");
GivePlayerWeapon(playerid,32,250);
GivePlayerWeapon(playerid,26,250);
GivePlayerWeapon(playerid,22,250);
GivePlayerWeapon(playerid,31,250);
SetPlayerPos(playerid, 1653.2175,2409.2781,10.9262);
}
I haven't warning(Compiled). Later, I died in /dm1. I teleport /dm1 in first.

Help me please.

Sorry, My English is not bad ( )

Thanks...
Reply
#2

Place your code from OnPlayerDeath into OnPlayerSpawn.
Reply
#3

Quote:
Originally Posted by Remi-X
Place your code from OnPlayerDeath into OnPlayerSpawn.
No :S
Reply
#4

I think that you could do it with a zone system like this
Create zones and check whatever a player is in a zone with OnPayerDeath or PLAYER_STATE_WASTED with

Код:
  PlayerInfo[playerid][Area] = getPlayerZoneID(playerid) ;
then on

Код:
OnPlayerSpawn(playerid)
{
  if(PlayerInfo[playerid][Area] == x) SetPlayerPos(playerid, 1653.2175,2409.2781,10.9262);
}
Reply
#5

Quote:
Originally Posted by SavageTR
Quote:
Originally Posted by Remi-X
Place your code from OnPlayerDeath into OnPlayerSpawn.
No :S
Remi-X just tried to help you ? if you say no then people wont help you anymore.
So think before you say something.

/Artix
Reply
#6

Closed!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)