Help with DM spawns
#2

If I'm not wrong, this is what you want?
PHP код:
COMMAND:west(playeridparams)
     {
        new 
PlayerName[MAX_PLAYER_NAME];//Player name
        
GetPlayerName(playeridPlayerNamesizeof(PlayerName));
        if(
InDM[playerid] == 0)//if the player is not in DM
        
{//then
            
InDM[playerid] = 1// Now we will set him in DM so he will respawn at DM
            
SendClientMessage(playeridCOLOR_LIGHTBLUE "You have joined /west, to leave type /west again");//Message to tell him that he joined DM
            
format(Stringsizeof(String), "Server:{FFFFFF}%s(%d) has joined (/west)"PlayerNameplayerid);
            
SendClientMessageToAll(COLOR_LIGHTBLUEString);//Message to tell everyone that he joined DM
            
ResetPlayerWeapons(playerid);
            
SetPlayerInterior(playerid0); // we will set he's interior to 0
            
SetPlayerVirtualWorld(playerid10); // and same here Virtual World to 10
            
new rand random(sizeof(DMSpawns)); // DM Spawn
            
SetPlayerPos(playerid,2245.5874,-8967.5977,11.3574);
            
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Welcome to Old West Gunfights!"); 
            
GivePlayerWeapon(playerid,24,500); 
            
GivePlayerWeapon(playerid,25,200); 
            
GivePlayerWeapon(playerid,33,200); 
            
GivePlayerWeapon(playerid,4,0); 
        }
        else {
//if the player is already in DM, he will leave
            
InDM[playerid] = 0//So now we will set him as not in DM
            
SendClientMessage(playeridCOLOR_LIGHTBLUE"You have left /west to join again type /west");//We will send him a message to tell him that he left
            
SpawnPlayer(playerid);//We will spawn the player now
            
SetPlayerHealth(playerid100);//set he's health to 100
            
ResetPlayerWeapons(playerid);// and reset he's weapons
            
SetPlayerVirtualWorld(playerid0);//we will set he's virtual world to 0
            
SetPlayerInterior(playerid0);//also interior to 0
        
}
        return 
1;
}

Reply


Messages In This Thread
Help with DM spawns - by baki - 27.07.2017, 18:31
Re: Help with DM spawns - by aoky - 27.07.2017, 20:16
Re: Help with DM spawns - by baki - 27.07.2017, 20:24

Forum Jump:


Users browsing this thread: 2 Guest(s)