[Ajuda] Abrir portгo
#1

Olб gente tudo bem?

Gostariam que me ajuda-se com meu codigo de abrir portгo na hq de admin's que meu mapper fez, nгo estou consiguindo colocar apenas para admin abrir.

pawn Код:
if(strcmp(cmd, "/abriradmin", true) == 0)
    {
    if (PlayerInfo[playerid][pAdmin] >= 1) && PlayerToPoint(15.0, playerid, 1878.9000244, 703.2999878, 12.5000000)) { //GateGaragem
// ja tentei assim tbm
//if(IsPlayerAdmin(playerid)) && PlayerToPoint(15.0, playerid, 1878.9000244, 703.2999878, 12.5000000)) { //GateGaragem
    MoveObject( DIEGOFDP, 1878.9000244, 703.2999878, 7.0000000,3);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "* %s abriu este portгo!", sendername);
    ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GameTextForPlayer(playerid, "~g~Aberto", 5000, 3);
    SetTimer("adm2", 5000, false);
    } else {
    //SendClientMessage(playerid, COLOR_RED, "*** Voce nao esta perto do portao ou nao e ADMIN ***");
    }
    return 1;
    }
Reply
#2

PHP код:
if(strcmp(cmd"/abriradmin"true) == 0)
    {
    if (
PlayerInfo[playerid][pAdmin] < 1) && PlayerToPoint(15.0playerid1878.9000244703.299987812.5000000))
    { 
//GateGaragem
    
MoveObjectDIEGOFDP1878.9000244703.29998787.0000000,3);
    
GetPlayerName(playeridsendernamesizeof(sendername));
    
format(stringsizeof(string), "* %s abriu este portгo!"sendername);
    
ProxDetector(4.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    
GameTextForPlayer(playerid"~g~Aberto"50003);
    
SetTimer("adm2"5000false);
    } else {
    
//SendClientMessage(playerid, COLOR_RED, "*** Voce nao esta perto do portao ou nao e ADMIN ***");
    
}
    return 
1;
    } 
Reply
#3

Achei sse codigo no meu gm, ve se vocк consegue usa-lo :
Код:
CMD:portaoadm(playerid, params[])
{
    if((PlayerDados[playerid][Admin] < 1) && (PlayerDados[playerid][Helper] == false)) return SendClientMessage(playerid, BRANCO, "Vocк precisa ser admin ou helper para usar este comando!");
    MoveObject(PortaoHQ, 2205.10009766,1835.50000000,12.60000038, 4, 0.00000000, 0.00000000, 91.99951172);
    GameTextForPlayer(playerid, "Portao ~g~Aberto", 1000, 6);
    SetTimer("FecharPortao", 5000, false);
    return 1;
}
Reply
#4

PHP код:
if(strcmp(cmd"/abriradmin"true) == 0)
    {
    if(
PlayerInfo[playerid][pAdmin] >= 1) && PlayerToPoint(15.0playerid1878.9000244703.299987812.5000000)) { //GateGaragem
    
MoveObjectDIEGOFDP1878.9000244703.29998787.0000000,3);
    
GetPlayerName(playeridsendernamesizeof(sendername));
    
format(stringsizeof(string), "* %s abriu este portгo!"sendername);
    
ProxDetector(4.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    
GameTextForPlayer(playerid"~g~Aberto"50003);
    
SetTimer("adm2"5000false);
    } else {
    
//SendClientMessage(playerid, COLOR_RED, "*** Voce nao esta perto do portao ou nao e ADMIN ***");
    
}
    return 
1;
    } 
Reply
#5

Ambos codigos do TuGa e do Nice da erro

pawn Код:
C:\Users\Silvio\Desktop\SERVIDOR 2013\gamemodes\grandbps.pwn(40110) : error 029: invalid expression, assumed zero
C:\Users\Silvio\Desktop\SERVIDOR 2013\gamemodes\grandbps.pwn(40110) : error 001: expected token: ";", but found ")"
C:\Users\Silvio\Desktop\SERVIDOR 2013\gamemodes\grandbps.pwn(40110) : error 029: invalid expression, assumed zero
C:\Users\Silvio\Desktop\SERVIDOR 2013\gamemodes\grandbps.pwn(40110) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

40110: if(PlayerInfo[playerid][pAdmin] >= 1) && PlayerToPoint(15.0, playerid, 1878.9000244, 703.2999878, 12.5000000)) { //GateGaragem
Reply
#6

PHP код:
    if (PlayerInfo[playerid][pAdmin] < 1) && PlayerToPoint(15.0playerid1878.9000244703.299987812.5000000)); 
Reply
#7

ja tento assim
PHP код:
if(strcmp(cmd"/abriradmin"true) == 0)
{
    if(
PlayerToPoint(15.0playerid1878.9000244703.299987812.5000000))
    {
        if (
PlayerInfo[playerid][pAdmin] >= 1)
        { 
//GateGaragem
             
MoveObjectDIEGOFDP1878.9000244703.29998787.0000000,3);
             
GetPlayerName(playeridsendernamesizeof(sendername));
             
format(stringsizeof(string), "* %s abriu este portгo!"sendername);
             
ProxDetector(4.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
             
GameTextForPlayer(playerid"~g~Aberto"50003);
             
SetTimer("adm2"5000false);
        }
    }
    return 
1;

Reply
#8

Quote:
Originally Posted by Nice-.-
Посмотреть сообщение
PHP код:
    if (PlayerInfo[playerid][pAdmin] < 1) && PlayerToPoint(15.0playerid1878.9000244703.299987812.5000000)); 
wft?

pawn Код:
if(strcmp(cmd, "/abriradmin", true)){
    if(PlayerInfo[playerid][pAdmin] >= 1 && PlayerToPoint(15.0, playerid, 1878.9000244, 703.2999878, 12.5000000)){
        MoveObject(DIEGOFDP, 1878.9000244, 703.2999878, 7.0000000,3);
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "* %s abriu este portгo!", sendername);
        ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        GameTextForPlayer(playerid, "~g~Aberto", 5000, 3);
        SetTimer("adm2", 5000, false);
    }
    else{
        SendClientMessage(playerid, COLOR_RED, "*** Voce nao esta perto do portao ou nao e ADMIN ***");
    }
    return 1;
}
Reply
#9

Quote:
Originally Posted by mau.tito
Посмотреть сообщение
ja tento assim
PHP код:
if(strcmp(cmd"/abriradmin"true) == 0)
{
    if(
PlayerToPoint(15.0playerid1878.9000244703.299987812.5000000))
    {
        if (
PlayerInfo[playerid][pAdmin] >= 1)
        { 
//GateGaragem
             
MoveObjectDIEGOFDP1878.9000244703.29998787.0000000,3);
             
GetPlayerName(playeridsendernamesizeof(sendername));
             
format(stringsizeof(string), "* %s abriu este portгo!"sendername);
             
ProxDetector(4.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
             
GameTextForPlayer(playerid"~g~Aberto"50003);
             
SetTimer("adm2"5000false);
        }
    }
    return 
1;

assim nгo ficaria otimizado e daria mais linha ao code

Quote:
Originally Posted by Sky_.
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/abriradmin", true)){
    if(PlayerInfo[playerid][pAdmin] >= 1 && PlayerToPoint(15.0, playerid, 1878.9000244, 703.2999878, 12.5000000)){
        MoveObject(DIEGOFDP, 1878.9000244, 703.2999878, 7.0000000,3);
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "* %s abriu este portгo!", sendername);
        ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        GameTextForPlayer(playerid, "~g~Aberto", 5000, 3);
        SetTimer("adm2", 5000, false);
    }
    else{
        SendClientMessage(playerid, COLOR_RED, "*** Voce nao esta perto do portao ou nao e ADMIN ***");
    }
    return 1;
}
Reply
#10

obrigado a todos leeks,

e Parabens deu certo tito.
Muito Obrigado ^^

Quote:
Originally Posted by Nice-.-
Посмотреть сообщение
PHP код:
    if (PlayerInfo[playerid][pAdmin] < 1) && PlayerToPoint(15.0playerid1878.9000244703.299987812.5000000)); 
Quote:
Originally Posted by mau.tito
Посмотреть сообщение
ja tento assim
PHP код:
if(strcmp(cmd"/abriradmin"true) == 0)
{
    if(
PlayerToPoint(15.0playerid1878.9000244703.299987812.5000000))
    {
        if (
PlayerInfo[playerid][pAdmin] >= 1)
        { 
//GateGaragem
             
MoveObjectDIEGOFDP1878.9000244703.29998787.0000000,3);
             
GetPlayerName(playeridsendernamesizeof(sendername));
             
format(stringsizeof(string), "* %s abriu este portгo!"sendername);
             
ProxDetector(4.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
             
GameTextForPlayer(playerid"~g~Aberto"50003);
             
SetTimer("adm2"5000false);
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)