[Ajuda] Mundo virtual e /refresh
#1

Entгo, tф com um comando aqui de /refresh mas eu queria que se o player estivese num interior ele nгo pudesse usar, tentei assim mas nгo vai, da erro ao compilar:
pawn Код:
if(strcmp(cmd, "/refresh", true) == 0)
    {
     if(IsPlayerConnected(playerid))
     if(GetPlayerInterior(playerid) => 1) return SendClientMessage(playerid,-1,"Comando Proibido em Interiores");
     {
            SetPlayerVirtualWorld(playerid, 0);
            SetPlayerInterior(playerid,0);
            TextDrawHideForPlayer(playerid,lbt);
            TextDrawHideForPlayer(playerid,lbb);
            SendClientMessage(playerid,COLOR_YELLOW,"Refresh feito com sucesso, se ainda estiver com problemas fale com um admin!");
            return 1;
        }
        }
Alguйm sabe como fixar?

Tambйm queria que tal itens criados, exemplo: CreateDynamicObject(4571,2009.90002441,-155.00000000,256.29998779,0.00000000,0.00000000,0. 00000000); sу aparecessem no mundo virtual 1.

E tambйm queria pedir 1 comando para setar o mundo do player, vi 1 tutorial na wiki da samp mas nгo funcionou muito bem comigo.

E por ъltimo, queria que exemplo, esta bike: CreateVehicle(468,-1445.6392,-592.3033,1055.7831,90.2133,-1,-1,600); //bike 88 sу pudesse ser acessada por admins com a variбvel:
pawn Код:
if (PlayerInfo[playerid][pAdmin] >= 1)
Valeu, espero que vocкs possam me ajudar!
Reply
#2

pawn Код:
if(strcmp(cmd, "/refresh", true) == 0)
    {
     if(IsPlayerConnected(playerid))
     if(GetPlayerInterior(playerid) >= 1) return SendClientMessage(playerid,-1,"Comando Proibido em Interiores");
     {
            SetPlayerVirtualWorld(playerid, 0);
            SetPlayerInterior(playerid,0);
            TextDrawHideForPlayer(playerid,lbt);
            TextDrawHideForPlayer(playerid,lbb);
            SendClientMessage(playerid,COLOR_YELLOW,"Refresh feito com sucesso, se ainda estiver com problemas fale com um admin!");
            return 1;
        }
        }
pawn Код:
CreateDynamicObject(4571,2009.90002441,-155.00000000,256.29998779,0.00000000,0.00000000,0.00000000,ID DO MUNDO,-1,-1,250.00);// troque o ID DO MUNDO pelo qual vc quer lembrando -1 й para todos
Para setar o WV do player use
pawn Код:
SetPlayerVirtualWorld(playerid, NUMERO);
Reply
#3

pawn Код:
if(strcmp(cmd, "/refresh", true) == 0)
{
    if(GetPlayerInterior(playerid) => 1) return SendClientMessage(playerid,-1,"Comando Proibido em Interiores");
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerInterior(playerid,0);
    TextDrawHideForPlayer(playerid,lbt);
    TextDrawHideForPlayer(playerid,lbb);
    SendClientMessage(playerid,COLOR_YELLOW,"Refresh feito com sucesso, se ainda estiver com problemas fale com um admin!");
    return 1;
}
pawn Код:
if(GetPlayerVirtualWorld(playerid) == 1)
{
    CreateDynamicObject(4571,2009.90002441,-155.00000000,256.29998779,0.00000000,0.00000000,0. 00000000); sу
}
pawn Код:
COMMAND:setvw(playerid, params[])
{
    static ID, VW;
    if(sscanf("ui", ID, VW)) return SendClientMessage(playerid, -1, "/SetVW [playerid] [VW]");
    SetPlayerVirtualWorld(ID, VW);
    return 1;
}
pawn Код:
new Bike;
Bike = CreateVehicle(468,-1445.6392,-592.3033,1055.7831,90.2133,-1,-1,600); //

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(Bike = vehicleid)
    {
        if (PlayerInfo[playerid][pAdmin] >= 1) return 1;
        else return RemovePlayerFromVehicle(playerid),SendClientMessage(playerid, -1, "You're not a Admin!");
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by Case Sensitive
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/refresh", true) == 0)
{
    if(GetPlayerInterior(playerid) => 1) return SendClientMessage(playerid,-1,"Comando Proibido em Interiores");
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerInterior(playerid,0);
    TextDrawHideForPlayer(playerid,lbt);
    TextDrawHideForPlayer(playerid,lbb);
    SendClientMessage(playerid,COLOR_YELLOW,"Refresh feito com sucesso, se ainda estiver com problemas fale com um admin!");
    return 1;
}
pawn Код:
if(GetPlayerVirtualWorld(playerid) == 1)
{
    CreateDynamicObject(4571,2009.90002441,-155.00000000,256.29998779,0.00000000,0.00000000,0. 00000000); sу
}
pawn Код:
COMMAND:setvw(playerid, params[])
{
    static ID, VW;
    if(sscanf("ui", ID, VW)) return SendClientMessage(playerid, -1, "/SetVW [playerid] [VW]");
    SetPlayerVirtualWorld(ID, VW);
    return 1;
}
pawn Код:
new Bike;
Bike = CreateVehicle(468,-1445.6392,-592.3033,1055.7831,90.2133,-1,-1,600); //

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(Bike = vehicleid)
    {
        if (PlayerInfo[playerid][pAdmin] >= 1) return 1;
        else return RemovePlayerFromVehicle(playerid),SendClientMessage(playerid, -1, "You're not a Admin!");
    }
    return 1;
}
you can create the /setvw in strcmp?
here for misteques motives the pawn give me a error and dont compile, but i put the sscanf2 at the top and the new include 2.0 // sorry for the bad english.
thank you!
Reply
#5

pawn Код:
if(strcmp(cmd, "/setvw", true) == 0)
{
    new giveplayerid,tmp[64],idx,string[128];
    tmp = strtok(params, idx);
    giveplayerid = ReturnUser(tmp);
    if(!strlen(tmp))return SendClientMessage(playerid, -1, "[Sugestгo:] /setvw [playerid] [virtualworld]");
    new virid;
    tmp = strtok(params, idx);
    virid = strval(tmp);
    if(!strlen(tmp))return SendClientMessage(playerid, -1, "[Sugestгo:] /setvw [playerid]  [virtualworld]");
    else if(giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, -1, "[Erro:] Jogador nгo encontrado.");
    else
    {
        SetPlayerVirtualWorld(giveplayerid, virid);
    }
    return 1;
}
Existe a include sscanf 1.0 que nгo utiliza plugin, se vocк nгo conseguir de jeito nenhum usar a 2.0, eu aconselho usa-la.
Reply
#6

Quote:
Originally Posted by Larceny
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/setvw", true) == 0)
{
    new giveplayerid,tmp[64],idx,string[128];
    tmp = strtok(params, idx);
    giveplayerid = ReturnUser(tmp);
    if(!strlen(tmp))return SendClientMessage(playerid, -1, "[Sugestгo:] /setvw [playerid] [virtualworld]");
    new virid;
    tmp = strtok(params, idx);
    virid = strval(tmp);
    if(!strlen(tmp))return SendClientMessage(playerid, -1, "[Sugestгo:] /setvw [playerid]  [virtualworld]");
    else if(giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, -1, "[Erro:] Jogador nгo encontrado.");
    else
    {
        SetPlayerVirtualWorld(giveplayerid, virid);
    }
    return 1;
}
Existe a include sscanf 1.0 que nгo utiliza plugin, se vocк nгo conseguir de jeito nenhum usar a 2.0, eu aconselho usa-la.
Valeu, rep+!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)