#1

Am gasit o comanda intr-un gamemode RP am incercat sa o modific atunci cand ai numele de ex : BogdaN sa respawneze masina din Gamemode care incepe cu BogdaN = AddStatic dar cand dau /park distruge masina ... help

pawn Code:
if(strcmp(cmd, "/park",true) == 0)
                {
                new Float:x,Float:y,Float:z;
                new Float:a;
                new pname[MAX_PLAYER_NAME];
                GetPlayerName(playerid, pname, sizeof pname);
                new carid;
//                new getcarid;
/*                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey])
                {
                carid = PlayerInfo[playerid][pPcarkey];
                }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; }
                else { return 1; }*/

                if(!IsPlayerInAnyVehicle(playerid))
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You are not in a car!");
                    return 1;
                }
//                getcarid = GetPlayerVehicleID(playerid);
                GetPlayerName(playerid, playername, sizeof(playername));
                GetVehiclePos(carid, x, y, z);
                GetPlayerFacingAngle(playerid, a);
                GetVehicleZAngle(carid, a);
                /*if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
                {
                    if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 & PlayerInfo[playerid][pPcarkey3])
                    {
                        SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");
                        return 1;
                    }*/

                    if(strcmp(pname, "BogdaN", true) == 0)
                    {
                        CarInfo[BogdaN][cLocationx] = x;
                        CarInfo[BogdaN][cLocationy] = y;
                        CarInfo[BogdaN][cLocationz] = z;
                        CarInfo[BogdaN][cAngle] = a;
                        format(string, sizeof(string), "~n~ You have parked your vehicle in this location. ~n~");
                        GameTextForPlayer(playerid, "You have parked your vehicle in this position. It will respawn here.", 10000, 3);
                        OnPropUpdate();
                        OnPlayerUpdate(playerid);
                        DestroyVehicle(BogdaN);
                        CreateVehicle(CarInfo[BogdaN][cModel],CarInfo[BogdaN][cLocationx],CarInfo[BogdaN][cLocationy],CarInfo[BogdaN][cLocationz]+1.0,CarInfo[BogdaN][cAngle],CarInfo[BogdaN][cColorOne],CarInfo[BogdaN][cColorTwo],60000);
                        TogglePlayerControllable(playerid, 1);
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "You don't own a premium car.");
                        return 1;
                    }
                }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)