Jump to content
  • 0

SpawnPlayer # Ajutor


Sn4Ke

Question

Problema intalnita (descriere):Vreau sa mut spawnu-l, serverul ruleaza pe mysql.
Ero(area / rile) / warning-(ul / urile):-
Liniile de cod / sursa / script-ul:

PlayerData[playerid][pPos_x] = 1106.6024;
    PlayerData[playerid][pPos_y] = -1790.6959;
    PlayerData[playerid][pPos_z] = 16.5938;

 

si mai am si asa

 

if(PlayerData[playerid][pReg] == 0)
        {
            PlayerData[playerid][pLevel] = 1;
            PlayerData[playerid][pSHealth] = 0.0;
            PlayerData[playerid][pHealth] = 50.0;
            PlayerData[playerid][pArmour] = 0.0;
            PlayerData[playerid][pPos_x] = 1106.6024;
            PlayerData[playerid][pPos_y] = -1790.6959;
            PlayerData[playerid][pPos_z] = 16.5938;
            PlayerData[playerid][pInt] = 15;
            PlayerData[playerid][pLocal] = 255;
            PlayerData[playerid][pTeam] = 3;
            PlayerData[playerid][pModel] = 264;
            new randphone = 1000000 + random(8999999);//minimum 1000  max 9999 //giving one at the start
            PlayerData[playerid][pPnumber] = randphone;
            PlayerData[playerid][pPhousekey] = 255;
            PlayerData[playerid][pPbiskey] = 255;
            PlayerData[playerid][pPcarkey] = 999;
            PlayerData[playerid][pAccount] = 5000;
            PlayerData[playerid][pReg] = 1;
            PlayerData[playerid][pLocked] = 0;
            GivePlayerCash(playerid, 1000);
            format(string, sizeof(string), "UPDATE players SET Registered='%d' WHERE id=%d", PlayerData[playerid][pReg], PlayerData[playerid][pSQLID]);
            mysql_query(string);
            format(string, sizeof(string), "UPDATE players SET PhoneNr='%d' WHERE id=%d", PlayerData[playerid][pPnumber], PlayerData[playerid][pSQLID]);
            mysql_query(string);
            format(string, sizeof(string), "UPDATE players SET House='%d' WHERE id=%d", PlayerData[playerid][pPhousekey], PlayerData[playerid][pSQLID]);
            mysql_query(string);
            format(string, sizeof(string), "UPDATE players SET Car='%d' WHERE id=%d", PlayerData[playerid][pPcarkey], PlayerData[playerid][pSQLID]);
            mysql_query(string);
            format(string, sizeof(string), "UPDATE players SET Bank='%d' WHERE id=%d", PlayerData[playerid][pAccount], PlayerData[playerid][pSQLID]);
            mysql_query(string);
            format(string, sizeof(string), "UPDATE players SET Locked='%d' WHERE id=%d", PlayerData[playerid][pLocked], PlayerData[playerid][pSQLID]);
            mysql_query(string);

        }

Imagini / Video (optional):-
Ati incercat sa rezolvati singur?:Da am incercat am schimbat coordonatele!

Am schimbat chiar si aici

for(new i = 0; i <= sizeof(Peds)-1; i++)
    {
        AddPlayerClass(Peds[0],1106.6024,-1790.6959,16.5938,90.2357,-1,-1,-1,-1,-1,-1);
    }
     AddPlayerClass(60,1106.6024,-1790.6959,16.5938,90.2357,0,0,0,0,-1,-1);
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
    {
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.

        if(!strcmp(npcname, "[SFLVLS]Train", true)) //Checking if the NPC's name is MyFirstNPC
        {
              PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 538); //Putting the NPC into the vehicle we created for it.
              SetPlayerInterior(playerid,0);
            TogglePlayerClock(playerid,0);
        }
        if(strcmp(npcname, "[LSSF]Pilot", true) ==  0) //Checking if the NPC's name is MyFirstNPC
        {
              PutPlayerInVehicle(playerid, npclssf, 538); //Putting the NPC into the vehicle we created for it.
              SetPlayerInterior(playerid,0);
            TogglePlayerClock(playerid,0);
        }
        if(strcmp(npcname, "[LSLV]Pilot", true) ==  0) //Checking if the NPC's name is MyFirstNPC
        {
              PutPlayerInVehicle(playerid, npclslv, 538); //Putting the NPC into the vehicle we created for it.
              SetPlayerInterior(playerid,0);
            TogglePlayerClock(playerid,0);
        }
        if(!strcmp(npcname, "[LS02]BusDriver", true)) //Checking if the NPC's name is MyFirstNPC
        {
              PutPlayerInVehicle(playerid, LS02BUS, 538); //Putting the NPC into the vehicle we created for it.
              SetPlayerInterior(playerid,0);
            TogglePlayerClock(playerid,0);
        }
        if(!strcmp(npcname, "[LS01]BusDriver", true)) //Checking if the NPC's name is MyFirstNPC
        {
              PutPlayerInVehicle(playerid, LS01BUS, 538); //Putting the NPC into the vehicle we created for it.
              SetPlayerInterior(playerid,0);
            TogglePlayerClock(playerid,0);
        }
        if(!strcmp(npcname, "[LSSF]BusDriver", true)) //Checking if the NPC's name is MyFirstNPC
        {
              PutPlayerInVehicle(playerid, LSSFBUS, 538); //Putting the NPC into the vehicle we created for it.
              SetPlayerInterior(playerid,0);
            TogglePlayerClock(playerid,0);
        }
        if(!strcmp(npcname, "[LSLVSF]Train", true)) //Checking if the NPC's name is MyFirstNPC
        {
              PutPlayerInVehicle(playerid, LS01MOTOR, 538); //Putting the NPC into the vehicle we created for it.
              SetPlayerInterior(playerid,0);
            TogglePlayerClock(playerid,0);
        }
        if(!strcmp(npcname, "Vanzator", true)) //Checking if the NPC's name is MyFirstNPC
        {
            SetPlayerSkin(playerid, 93);
              SetPlayerInterior(playerid,0);
            TogglePlayerClock(playerid,0);
        }
        return 1;
    }
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.