How to have all Players spawn in SF?
#1

Hello, I'm trying to make it so every Player that spawns into the world will randomly spawn somewhere in San Fierro? but the police officers/medics spawn at their job locations, example Police station and hospital.

if you know the fix to this, i would love to hear it
Reply
#2

if(gTeam[playerid] == 266)
{
SetPlayerPos(playerid, coordinates);
}
Reply
#3

With that ammount of information you have given us you will not receive any help from me or others!
Reply
#4

PHP код:
public OnGameModeInIt()
{
    new 
rand random(2)
    return 
1;
}

public 
OnPlayerSpawn(playerid)
{
      if(
IsCop[playerid] == 1)
      {
             
SetPlayerPos(playeridcopxcopycopz);
      }
      else if(
IsMedic[playerid] == 1)
      {
             
SetPlayerPos(playeridmedicxmedicymedicz);
      }
      else
      switch(
rand)
      {
            case 
0SetPlayerPos(playeridxyz);
            case 
1SetPlayerPos(playeridxyz);
            case 
2SetPlayerPos(playeridxyz);
       }
       return 
1;

It's something like this.
Reply
#5

Take a look at your OnPlayerSpawn, probably there is a SetPlayerPos there, if so, check if it's the current spawn coords that it holds, and if the coords match the current spawn coords, change them to your SF spawn place.
Reply
#6

Okay, my second question is, how do i allow it so noone spawns with weapons besides officers and army soldiers, it may have something to do with this part?

if(ServerInfo[GiveWeap] == 1) {
if(PlayerInfo[playerid][LoggedIn] == 1) {
PlayerInfo[playerid][TimesSpawned]++;
if(PlayerInfo[playerid][TimesSpawned] == 1)

{
GivePlayerWeapon(playerid, dUserINT(PlayerName2(playerid)).("weap1"), dUserINT(PlayerName2(playerid)).("weap1ammo") );
GivePlayerWeapon(playerid, dUserINT(PlayerName2(playerid)).("weap2"), dUserINT(PlayerName2(playerid)).("weap2ammo") );
GivePlayerWeapon(playerid, dUserINT(PlayerName2(playerid)).("weap3"), dUserINT(PlayerName2(playerid)).("weap3ammo") );
GivePlayerWeapon(playerid, dUserINT(PlayerName2(playerid)).("weap4"), dUserINT(PlayerName2(playerid)).("weap4ammo") );
GivePlayerWeapon(playerid, dUserINT(PlayerName2(playerid)).("weap5"), dUserINT(PlayerName2(playerid)).("weap5ammo") );
GivePlayerWeapon(playerid, dUserINT(PlayerName2(playerid)).("weap6"), dUserINT(PlayerName2(playerid)).("weap6ammo") );
Reply
#7

PHP код:
if(IsCop[playerid] == 1) && if(IsOfficer[playerid] == 1)
{
     
GivePlayerWeapon(playeriddUserINT(PlayerName2(playerid)).("weap1"), dUserINT(PlayerName2(playerid)).("weap1ammo")    );
GivePlayerWeapon(playeriddUserINT(PlayerName2(playerid)).("weap2"), dUserINT(PlayerName2(playerid)).("weap2ammo")    );
GivePlayerWeapon(playeriddUserINT(PlayerName2(playerid)).("weap3"), dUserINT(PlayerName2(playerid)).("weap3ammo")    );
GivePlayerWeapon(playeriddUserINT(PlayerName2(playerid)).("weap4"), dUserINT(PlayerName2(playerid)).("weap4ammo")    );
GivePlayerWeapon(playeriddUserINT(PlayerName2(playerid)).("weap5"), dUserINT(PlayerName2(playerid)).("weap5ammo")    );
GivePlayerWeapon(playeriddUserINT(PlayerName2(playerid)).("weap6"), dUserINT(PlayerName2(playerid)).("weap6ammo")    );
}
else
   return 
0
Somthing like this,
Reply
#8

can i have more indepth help private200? i tried to do it, but it came up with 5 errors
Reply
#9

My codes are made randomly because you have to change the "IsCop" to the faction or group of your server.
Reply
#10

Quote:
Originally Posted by Private200
Посмотреть сообщение
My codes are made randomly because you have to change the "IsCop" to the faction or group of your server.
Hmm, This is what mine is saying
PHP код:
error 017undefined symbol "Cop"
warning 215expression has no effect
error 001
expected token";"but found "]"
error 029invalid expressionassumed zero
fatal error 107
too many error messages on one line 
i have Swat, Cop and Army, but its only picking up Army
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)