[Ajuda] Comando em strcmp
#1

Ola pessoal, Estou com um FS aqui e nele tem alguns comando em CMD e eu estou querendo converter esses comandos para strcmp mais nгo estou conseguindo. Sempre que eu faзo aparece "Pawn Parou de funcionar".

PS: Usei Search Forum SA:MP e ****** e nada.

pawn Код:
CMD:x1(playerid)
{
    if (InfoArena[playerid][InArena] == true || InfoArena[playerid][X1] == true ) return SendClientMessage(playerid, PadraoColor, "[ERRO] Retire-se da arena /kill");
    if (InX1 == 2) return SendClientMessage(playerid, PadraoColor, "[ERRO] {FFFFFF}A Arena estб lotada, aguarde...");
    new pos = random(6), H3String[128], Name[24];
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid, 38, 9999);
    GivePlayerWeapon(playerid, 35, 9999);
    GivePlayerWeapon(playerid, 38, 9999);
    GivePlayerWeapon(playerid, 16, 999);
    GivePlayerWeapon(playerid, 24, 999);
    SetPlayerArmour(playerid, 100.0);
    SetPlayerHealth(playerid, 100.0);
    InX1 ++;
    GetPlayerName(playerid, Name, 24);
    format ( H3String, 128, "[ARENA]{FFFFFF} %s foi para a arena: X1. ( /x1 )", Name);
    SendClientMessageToAll(PadraoColor, H3String);
    InfoArena[playerid][X1] = true;
    SetPlayerVirtualWorld(playerid, WORLD_X1);
    if (pos < 3) SetPlayerPos(playerid,-2339.7571,412.1153,73.2578);
    if (pos >= 3) SetPlayerPos(playerid, -2446.6318,445.8134,73.2578);
    return 1;
}


CMD:bz(playerid)
{
    if (InfoArena[playerid][InArena] == true || InfoArena[playerid][X1] == true ) return SendClientMessage(playerid, PadraoColor, "[ERRO] Retire-se da arena /kill");
    new pos = random(6), H3String[128], Name[24];
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid, 35, 9999);
    SetPlayerArmour(playerid, 100.0);
    SetPlayerHealth(playerid, 100.0);
    GetPlayerName(playerid, Name, 24);
    format ( H3String, 128, "[ARENA]{FFFFFF} %s foi para a arena: bazuca. ( /mg )", Name);
    SendClientMessageToAll(PadraoColor, H3String);
    InfoArena[playerid][InArena] = true;
    SetPlayerVirtualWorld(playerid, WORLD_BZ);
    if (pos < 3) SetPlayerPos(playerid,-2339.7571,412.1153,73.2578);
    if (pos >= 3) SetPlayerPos(playerid, -2446.6318,445.8134,73.2578);
    return 1;
}


CMD:mg(playerid)
{
    if (InfoArena[playerid][InArena] == true || InfoArena[playerid][X1] == true ) return SendClientMessage(playerid, PadraoColor, "[ERRO] Retire-se da arena /kill");
    new pos = random(6), H3String[128], Name[24];
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid, 38, 9999);
    SetPlayerArmour(playerid, 100.0);
    SetPlayerHealth(playerid, 100.0);
    GetPlayerName(playerid, Name, 24);
    format ( H3String, 128, "[ARENA]{FFFFFF} %s foi para a arena: minigun. ( /mg )", Name);
    SendClientMessageToAll(PadraoColor, H3String);
    InfoArena[playerid][InArena] = true;
    SetPlayerVirtualWorld(playerid, WORLD_MG);
    if (pos < 3) SetPlayerPos(playerid,-2339.7571,412.1153,73.2578);
    if (pos >= 3) SetPlayerPos(playerid, -2446.6318,445.8134,73.2578);
    return 1;
}


CMD:granada(playerid)
{
    if (InfoArena[playerid][InArena] == true || InfoArena[playerid][X1] == true ) return SendClientMessage(playerid, PadraoColor, "[ERRO] Retire-se da arena /kill");
    new pos = random(6), H3String[128], Name[24];
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid, 16, 999);
    SetPlayerArmour(playerid, 100.0);
    SetPlayerHealth(playerid, 100.0);
    GetPlayerName(playerid, Name, 24);
    format ( H3String, 128, "[ARENA]{FFFFFF} %s foi para a arena: granada. ( /granada )", Name);
    SendClientMessageToAll(PadraoColor, H3String);
    InfoArena[playerid][InArena] = true;
    SetPlayerVirtualWorld(playerid, WORLD_GRANADA);
    if (pos < 3) SetPlayerPos(playerid,1407.8090,-1488.8660,125.3697);
    if (pos >= 3) SetPlayerPos(playerid, 1431.5345,-1452.7095,125.3672);
    return 1;
}


CMD:pistola(playerid)
{
    if (InfoArena[playerid][InArena] == true || InfoArena[playerid][X1] == true ) return SendClientMessage(playerid, PadraoColor, "[ERRO] Retire-se da arena /kill");
    new pos = random(6), H3String[128], Name[24];
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid, 24, 999);
    SetPlayerArmour(playerid, 100.0);
    SetPlayerHealth(playerid, 100.0);
    GetPlayerName(playerid, Name, 24);
    format ( H3String, 128, "[ARENA]{FFFFFF} %s foi para a arena: pistola. ( /pistola )", Name);
    SendClientMessageToAll(PadraoColor, H3String);
    InfoArena[playerid][InArena] = true;
    SetPlayerVirtualWorld(playerid, WORLD_PISTOLA);
    if (pos < 3) SetPlayerPos(playerid,1407.8090,-1488.8660,125.3697);
    if (pos >= 3) SetPlayerPos(playerid, 1431.5345,-1452.7095,125.3672);
    return 1;
}


CMD:doze(playerid)
{
    if (InfoArena[playerid][InArena] == true || InfoArena[playerid][X1] == true ) return SendClientMessage(playerid, PadraoColor, "[ERRO] Retire-se da arena /kill");
    new pos = random(6), H3String[128], Name[24];
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid, 25, 999);
    SetPlayerArmour(playerid, 100.0);
    SetPlayerHealth(playerid, 100.0);
    GetPlayerName(playerid, Name, 24);
    format ( H3String, 128, "[ARENA]{FFFFFF} %s foi para a arena: doze. ( /doze )", Name);
    SendClientMessageToAll(PadraoColor, H3String);
    InfoArena[playerid][InArena] = true;
    SetPlayerVirtualWorld(playerid, WORLD_DOZE);
    if (pos < 3) SetPlayerPos(playerid,1407.8090,-1488.8660,125.3697);
    if (pos >= 3) SetPlayerPos(playerid, 1431.5345,-1452.7095,125.3672);
    return 1;
}



CMD:kill(playerid)
{
    SetPlayerHealth(playerid, 0.0);
    return 1;
}
Quem puder me ajuda, fico muito grato!
Pena que nгo posso dar +Rep ainda.
Reply
#2

Й sу trocar:
pawn Код:
CMD:nomedocomando(playerid)
por:
pawn Код:
if(strcmp(cmdtext,"/nomedocomando",true) == 0)
E colocar na callback OnPlayerCommandText
Reply
#3

Obrigado MultiKill, Resolvido.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)