2problems.
#1

Hello, im have 3problems with TDM server... So, im maked a message, when player connected joined some team. Now, when player connect, choose Triads spawn, spawn and death server send message to all: *Name* joined Triads team. ( but he doesnt press f4, and change team. )

example:

Код:
SetPlayerToTeamColour(playerid) // Funkcija
{ // Atidarymas
    if(IsPlayerNPC(playerid)) return 1; // Jei ћaidėjas NPC - nieko jam nedarom
	new Vardaz[MAX_PLAYER_NAME]; // Vardo gavimo kintamasis
	GetPlayerName(playerid,Vardaz,sizeof(Vardaz)); // Gauna ћaidėjo vardą
	new mess[65]; // String
    if(ZaidejoKomanda[playerid] == Yakuza) // Patikrinam, ar ћaidėjas yra Yakuza komandoje.
    { // Atidarom funkciją
        SetPlayerColor(playerid,ySpalva); // Mėlyna
        for(new i=0; i<MAX_PLAYERS; i++) SetPlayerMarkerForPlayer( i, playerid, ( GetPlayerColor( playerid ) & ySpalva ) );
        NustatytiGyvybes(playerid, 100); // Gyvybės
        NustatytiLygi(playerid, WEAPONSKILL_DESERT_EAGLE, 0); // Nustatom Deagle skill lygį į 0
        NustatytiLygi(playerid, WEAPONSKILL_MP5, 0); // Nustatom MP5 skill lygį į 0
        NustatytiLygi(playerid, WEAPONSKILL_AK47, 0); // Nustatom AK-47 skill lygį į 0
        NustatytiLygi(playerid, WEAPONSKILL_SHOTGUN, 0); // Nustatom Shotgun skill lygį į 0
        format(mess,sizeof(mess),"GangWars: %s joined Yakuza team",Vardaz); // Formatuoja
        SendClientMessageToAll(MELYNA,mess); // Nusiunčia ћaidėjams
       	SetPlayerTeam(playerid,Yakuza); // Komanda
    }
//// another shit
now, problem with commands.. so, im created 4npc bots. Now, when i using teleport cmd. ( /teleportuotis [ID/name) example: player name are ShadowX, im typing /teleportuotis ShadowX, and my pos setting to Yakuza NPC bot.. and if ShadowX in car, im typing /gautiz ( gets player ) server just teleporting some unused car, and 'attach' +3 metres at Z coordinates. so what swrong? ;X
Код:
//===========================[Teleportavimasis]===========================================
COMMAND:teleportuotis(playerid, params[])
{
    new
        id = strval(params),
        Float:x,
        Float:y,
        Float:z;
        GetPlayerPos(id, x, y, z);
    if (ZaidejoInformacija[playerid][Padejejas] <= 0) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Рi komanda TIK Padejлjams!", "Gerai", "Uюdaryti");
	if(id == playerid) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Kam teleportuotis pas save?", "Gerai", "Uюdaryti");
    if (isnull(params)) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Naudojimas: /teleportuotis [ID]", "Gerai", "Uюdaryti");
    if(IsPlayerInAnyVehicle(playerid))
    {
    SetVehiclePos(playerid, x, y, z+3);
	}else{
    SetPlayerPos(playerid, x + 1, y + 1, z);
    }
    return 1;
}
//===========================[Teleportavimasis]===========================================
COMMAND:gautiz(playerid, params[])
{
    new
        id = strval(params),
        Float:x,
        Float:y,
        Float:z;
        GetPlayerPos(playerid, x, y, z);
    if (ZaidejoInformacija[playerid][Padejejas] <= 0) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Рi komanda TIK Padejлjams!", "Gerai", "Uюdaryti");
    if (isnull(params)) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Naudojimas: /gautiz [ID]", "Gerai", "Uюdaryti");
    if(id == playerid) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Kam teleportuotis pas save?", "Gerai", "Uюdaryti");
    if(IsPlayerNPC(id)) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "NPC atsiteleportuoti negalima", "Gerai", "Uюdaryti");
    if(IsPlayerInAnyVehicle(id))
    {
    SetVehiclePos(id, x, y, z+3);
	}else{
    NustatytiPozicija(id, x + 1, y + 1, z);
    }
    return 1;
}
Reply
#2

UP. 8chars
Reply
#3

BUMPP.....
Reply
#4

Hmm. I would help you, if the script was in English because I don't know shit about any of that script.

Sorry.
Reply
#5

Код:
//===========================[Teleportavimasis]===========================================
COMMAND:top(playerid, params[])
{
    new
        id = strval(params),
        Float:x,
        Float:y,
        Float:z;
        GetPlayerPos(id, x, y, z);
    if (PlayerInfo[playerid][gHelper] <= 0) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Рi komanda TIK Padejлjams!", "Gerai", "Uюdaryti");
	if(id == playerid) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Kam teleportuotis pas save?", "Gerai", "Uюdaryti");
    if (isnull(params)) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Naudojimas: /teleportuotis [ID]", "Gerai", "Uюdaryti");
    if(IsPlayerInAnyVehicle(playerid))
    {
    SetVehiclePos(playerid, x, y, z+3);
	}else{
    SetPlayerPos(playerid, x + 1, y + 1, z);
    }
    return 1;
}
//===========================[Teleportavimasis]===========================================
COMMAND:getp(playerid, params[])
{
    new
        id = strval(params),
        Float:x,
        Float:y,
        Float:z;
        GetPlayerPos(playerid, x, y, z);
    if (PlayerInfo[playerid][gHelper] <= 0) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Рi komanda TIK Padejлjams!", "Gerai", "Uюdaryti");
    if (isnull(params)) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Naudojimas: /gautiz [ID]", "Gerai", "Uюdaryti");
    if(id == playerid) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Kam teleportuotis pas save?", "Gerai", "Uюdaryti");
    if(IsPlayerNPC(id)) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "NPC atsiteleportuoti negalima", "Gerai", "Uюdaryti");
    if(IsPlayerInAnyVehicle(id))
    {
    SetVehiclePos(id, x, y, z+3);
	}else{
    SetPlayerPos(id, x + 1, y + 1, z);
    }
    return 1;
}
now? :.
Reply
#6

Here is the /gautiz command already
Код:
COMMAND:gautiz(playerid, params[])
{
    new
        id = strval(params),
        vehid,
        seat,
        Float:x,
        Float:y,
        Float:z;
        GetPlayerPos(playerid, x, y, z);
    if (PlayerInfo[playerid][gHelper] <= 0) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Рi komanda TIK Padejлjams!", "Gerai", "Uюdaryti");
    if (isnull(params)) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Naudojimas: /gautiz [ID]", "Gerai", "Uюdaryti");
    if(id == playerid) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Kam teleportuotis pas save?", "Gerai", "Uюdaryti");
    if(IsPlayerNPC(id)) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "NPC atsiteleportuoti negalima", "Gerai", "Uюdaryti");
    if(IsPlayerInAnyVehicle(id))
    {
    seat = GetPlayerVehicleSeat(id);
    vehid = GetPlayerVehicleID(id);
    SetVehiclePos(vehid, x+1, y+1, z+1.3);
    PutPlayerInVehicle(id,vehid,seat);
	}else{
    SetPlayerPos(id, x + 1, y + 1, z);
    }
    return 1;
}
ill edit post if i done the /top command.

here it is but i think the bug is that u cant type players name but only id.. for player name use sscanf
Код:
COMMAND:teleportuotis(playerid, params[])
{
    new
        id = strval(params),
        seat,
        vehid,
        Float:x,
        Float:y,
        Float:z;
        GetPlayerPos(id, x, y, z);
    if (PlayerInfo[playerid][gHelper] <= 0) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Рi komanda TIK Padejлjams!", "Gerai", "Uюdaryti");
	if(id == playerid) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Kam teleportuotis pas save?", "Gerai", "Uюdaryti");
    if (isnull(params)) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Naudojimas: /teleportuotis [ID]", "Gerai", "Uюdaryti");
    if(IsPlayerInAnyVehicle(playerid))
    {
    seat = GetPlayerVehicleSeat(id);
    vehid = GetPlayerVehicleID(id);
    SetVehiclePos(playerid, x+1, y+1, z+1.3);
    PutPlayerInVehicle(playerid,vehid,seat);
	}else{
    SetPlayerPos(playerid, x + 1, y + 1, z);
    }
    return 1;
}
Reply
#7

Ok, im will use sscanf, but i cant test it now. It will work?

Код:
COMMAND:teleportuotis(playerid, params[])
{
    new
        id,
        seat,
        vehid,
        Float:x,
        Float:y,
        Float:z;
        GetPlayerPos(id, x, y, z);
    if (PlayerInfo[playerid][gHelper] <= 0) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Рi komanda TIK Padejлjams!", "Gerai", "Uюdaryti");
	if(id == playerid) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Kam teleportuotis pas save?", "Gerai", "Uюdaryti");
    if(sscanf(params,"u", id)) return SukurtiDialog(playerid, 5, DIALOG_STYLE_MSGBOX,"GangWars", "Naudojimas: /teleportuotis [Vardas]!", "Gerai", "Uюdaryti");
    if(IsPlayerInAnyVehicle(playerid))
    {
    seat = GetPlayerVehicleSeat(id);
    vehid = GetPlayerVehicleID(id);
    SetVehiclePos(playerid, x+1, y+1, z+1.3);
    PutPlayerInVehicle(playerid,vehid,seat);
	}else{
    SetPlayerPos(playerid, x + 1, y + 1, z);
    }
    return 1;
}
Reply
#8

if the only thing u changed is the sscanf and not the invehiclepart or sumthing then yes, im pretty sure
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)