Jump to content
  • 0

Eroare Fast Event si Anti Lag Shoot


andrein2

Question

Imi da o eroare la anti lag shoot si la fast event nu apare cati bani primeste

Anti lag Shoot

k9gu.jpg

[pawn]C:\Users\Razvan\Desktop\Game4Win RolePlay\gamemodes\G4W.pwn(44463) : error 029: invalid expression, assumed zero

C:\Users\Razvan\Desktop\Game4Win RolePlay\gamemodes\G4W.pwn(44463) : error 017: undefined symbol "damagedid"

C:\Users\Razvan\Desktop\Game4Win RolePlay\gamemodes\G4W.pwn(44465) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Users\Razvan\Desktop\Game4Win RolePlay\gamemodes\G4W.pwn(44468) : error 017: undefined symbol "damagedid"

C:\Users\Razvan\Desktop\Game4Win RolePlay\gamemodes\G4W.pwn(44470) : error 017: undefined symbol "weaponid"

C:\Users\Razvan\Desktop\Game4Win RolePlay\gamemodes\G4W.pwn(44471) : error 017: undefined symbol "amount"

C:\Users\Razvan\Desktop\Game4Win RolePlay\gamemodes\G4W.pwn(44476) : warning 225: unreachable code

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

5 Errors.

[/pawn]

Si la fast event

[pawn] if(Answered == 0)

{

    new idx;

    tmp = strtok(text, idx);

if ((strcmp(FastString, tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen(FastString)))

{

Answered = 1;

GetPlayerName(playerid, sendername, sizeof(sendername));

format(string, sizeof(string), "{DC0C0C}Fast Event: {FFFFFF}%s a castigat fast-eventul si a primit $%d!", sendername);

OOCNews(COLOR_LIGHTBLUE, string);

new randrd = 1000 + random(500);

GivePlayerCash(playerid, randrd);

return 0;

}

}[/pawn]

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

Spunemi terog unde este gresit sa vad ca nu sunt expert ca voi :)

Edit: Am rezolvat l-am mutat dar imi da eroarea asta acum

[pawn]C:\Users\Razvan\Desktop\Game4Win RolePlay\gamemodes\G4W.pwn(4008) : error 021: symbol already defined: "OnPlayerGiveDamage"[/pawn]

[pawn]public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)

    {

        new string[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME];

        new weaponname[24];

        GetPlayerName(playerid, attacker, sizeof (attacker));

        GetPlayerName(damagedid, victim, sizeof (victim));

        GetWeaponName(weaponid, weaponname, sizeof (weaponname));

        format(string, sizeof(string), "%s has made %.0f damage to %s, weapon: %s", attacker, amount, victim, weaponname);

        SendClientMessageToAll(0xFFFFFFFF, string);

        return 1;

    }[/pawn]

Link to comment
Share on other sites

Spunemi terog unde este gresit sa vad ca nu sunt expert ca voi :)

Edit: Am rezolvat l-am mutat dar imi da eroarea asta acum

[pawn]C:\Users\Razvan\Desktop\Game4Win RolePlay\gamemodes\G4W.pwn(4008) : error 021: symbol already defined: "OnPlayerGiveDamage"[/pawn]

[pawn]public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)

    {

        new string[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME];

        new weaponname[24];

        GetPlayerName(playerid, attacker, sizeof (attacker));

        GetPlayerName(damagedid, victim, sizeof (victim));

        GetWeaponName(weaponid, weaponname, sizeof (weaponname));

        format(string, sizeof(string), "%s has made %.0f damage to %s, weapon: %s", attacker, amount, victim, weaponname);

        SendClientMessageToAll(0xFFFFFFFF, string);

        return 1;

    }[/pawn]

Insfarsit, te-ai luminat.Acea eroare vrea sa spuna ca, callback-ul este definit de mai multe ori.

Link to comment
Share on other sites

Am editat si acum am eroarea aceasta

[pawn]C:\Users\Razvan\Desktop\Game4Win RolePlay\gamemodes\G4W.pwn(4006) : warning 225: unreachable code

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

1 Warning.[/pawn]

[pawn]public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)

{

if(Tazer[playerid] == 1 && GetPlayerWeapon(playerid) == TAZE_WEAPON)

{

    new Float:health,losehp;

    GetPlayerHealth(damagedid,health);

    losehp = TAZE_LOSEHP;

    if(Tazed[damagedid] == 1) return 1;

    new Float:x, Float:y, Float:z;

    GetPlayerPos(damagedid, x, y, z);

    ClearAnimations(damagedid);

    TogglePlayerControllable(damagedid, 0);

    ApplyAnimation(damagedid,"PED","KO_skid_front",4.1,0,1,1,1,0);

    ApplyAnimation(damagedid,"PED","KO_skid_front",4.1,0,1,1,1,0);

    SetTimerEx("TazedRemove", TAZE_TIMER, 0, "i", damagedid);

    Tazed[damagedid] = 1;

    if(losehp) {} else SetPlayerHealth(damagedid, health+amount);

}

return 1;

{

        new string[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME];

        new weaponname[24];

        GetPlayerName(playerid, attacker, sizeof (attacker));

        GetPlayerName(damagedid, victim, sizeof (victim));

        GetWeaponName(weaponid, weaponname, sizeof (weaponname));

        format(string, sizeof(string), "%s has made %.0f damage to %s, weapon: %s", attacker, amount, victim, weaponname);

        SendClientMessageToAll(0xFFFFFFFF, string);

}

return 1;

}[/pawn]

Link to comment
Share on other sites

[pawn]public OnPlayerGiveDamage ( playerid , damagedid , Float:amount , weaponid )

{

if ( Tazer [ playerid ] == 1 && GetPlayerWeapon ( playerid ) == TAZE_WEAPON )

{

    new

string    [      128      ] ,

victim    [ MAX_PLAYER_NAME ] ,

attacker  [ MAX_PLAYER_NAME ] ,

    weaponname [      124      ] ,

Float:pos  [        3        ] ,

Float:health                  ,

losehp

;

    if ( Tazed [ damagedid ] == 1 ) return ( 1 ) ;

    GetPlayerHealth ( damagedid , health ) ;

    losehp = TAZE_LOSEHP ;

    GetPlayerPos ( damagedid , pos [ 0 ] , pos [ 1 ] , pos [ 2 ] ) ;

    ClearAnimations ( damagedid ) ;

    TogglePlayerControllable ( damagedid , 0 ) ;

    ApplyAnimation ( damagedid , "PED" , "KO_skid_front" , 4.1 , 0 , 1 , 1 , 1 , 0 ) ;

    ApplyAnimation ( damagedid , "PED" , "KO_skid_front" , 4.1 , 0 , 1 , 1 , 1 , 0 ) ;

    SetTimerEx ( "TazedRemove" , TAZE_TIMER , 0 , "i" , damagedid ) ;

    Tazed [ damagedid ] = 1 ;

    if ( losehp ) { } else SetPlayerHealth ( damagedid , health + amount ) ;

        GetPlayerName ( playerid  , attacker  , sizeof ( attacker  ) ) ;

        GetPlayerName ( damagedid , victim    , sizeof ( victim    ) ) ;

        GetWeaponName ( weaponid  , weaponname , sizeof ( weaponname ) ) ;

        format ( string , sizeof ( string ) , "%s has made %.0f damage to %s, weapon: %s" , attacker , amount , victim , weaponname ) ;

        SendClientMessageToAll ( 0xFFFFFFFF , string ) ;

}

return ( 1 ) ;

}[/pawn]

EDIT: Codul arata nearanjat aici, dar in editor va arata bine.

Link to comment
Share on other sites

Pe mine ma intereseaza partea asta deoarce tazer-ul merge perfect dar vreau la deagle

[pawn] {

        new string[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME];

        new weaponname[24];

        GetPlayerName(playerid, attacker, sizeof (attacker));

        GetPlayerName(damagedid, victim, sizeof (victim));

        GetWeaponName(weaponid, weaponname, sizeof (weaponname));

        format(string, sizeof(string), "%s has made %.0f damage to %s, weapon: %s", attacker, amount, victim, weaponname);

        SendClientMessageToAll(0xFFFFFFFF, string);

}[/pawn]

Link to comment
Share on other sites

Asa asta am rezolvat si la fast event ?

Nu apare cati bani a castigat apare decat $

[pawn] if(Answered == 0)

{

    new idx;

    tmp = strtok(text, idx);

if ((strcmp(FastString, tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen(FastString)))

{

Answered = 1;

GetPlayerName(playerid, sendername, sizeof(sendername));

format(string, sizeof(string), "{DC0C0C}Fast Event: {FFFFFF}%s a castigat fast-eventul si a primit $%d!", sendername);

OOCNews(COLOR_LIGHTBLUE, string);

new randrd = 1000 + random(500);

GivePlayerCash(playerid, randrd);

return 0;

}

}[/pawn]

Link to comment
Share on other sites

[pawn] if(Answered == 0)

{

    new idx;

    tmp = strtok(text, idx);

if ((strcmp(FastString, tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen(FastString)))

{

Answered = 1;

OOCNews(COLOR_LIGHTBLUE, string);

new randrd = 1000 + random(500);

GivePlayerCash(playerid, randrd);

GetPlayerName(playerid, sendername, sizeof(sendername));

format(string, sizeof(string), "{DC0C0C}Fast Event: {FFFFFF}%s a castigat fast-eventul si a primit $%d!", sendername, randrd);

                        SendClientMessageToAll(0xFFFFFFFF, string);

return 0;

}

}[/pawn]

Link to comment
Share on other sites

Si mai am o problema cand nu am casa apare la House Key : 255 si cand cumpar casa tot lafel 

de ce nu se schimba (Ps: NU se schimba nici in baza de date)

5ome.jpg

[img width=500 height=399] sosi.jpg

[pawn] {

    new skin = GetPlayerSkin(targetid);

new interior = GetPlayerInterior(targetid);

new local = PlayerInfo[targetid][pLocal];

new vw = GetPlayerVirtualWorld(targetid);

new Float:health, Float:armour;

GetPlayerHealth(targetid,health);

GetPlayerArmour(targetid,armour);

format(coordsstring, sizeof(coordsstring), "| House key: %d | BizKey: %d | Skin: %d | Interior: %d | Virtual world: %d | Local: %d | Health: %.1f | Armour: %.1f |", PlayerInfo[targetid][pPhousekey],bizkey, skin, interior, vw, local, health, armour);

SendClientMessage(playerid, COLOR_LIGHTRED, coordsstring);

}[/pawn]

Link to comment
Share on other sites

Eu nu am /buyhouse eu dau /enter si apare Cumpara sau iesi

[pawn] if(dialogid == 300)

{

    if(response)

    {

        new h = HouseRequested[playerid];

        if(Houses[playerid] >= MAX_OWNABLE_HOUSE && PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, -1, "{DC0C0C}Casa: {FFFFFF}Ai ajuns la limita caselor pe care le poti detine!");

if(HouseInfo[h][hOwned] == 0)

{

    if(HouseInfo[h][hValue] <= GetPlayerCash(playerid))

    {

        if(PlayerInfo[playerid][pPhousekey] != 255) return SendClientMessage(playerid, COLOR_WHITE, "{DC0C0C}Casa: {FFFFFF}Trebuie sa renunti la chirie inainte sa cumperi o casa! (/unrentroom)");

        if(HouseInfo[h][hLevel] <= PlayerInfo[playerid][pLevel]) {} else return SendClientMessage(playerid, COLOR_WHITE, "{DC0C0C}Casa: {FFFFFF}Nu ai nivelul necesar!");

strmid(HouseInfo[h][hOwner], pName(playerid), 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);

format(string, sizeof(string), "Proprietatea lui %s", pName(playerid));

strmid(HouseInfo[h][hName], string, 0, 100, 100);

HouseInfo[h][hStorage] = 0;

HouseInfo[h][hLock] = 1;

HouseInfo[h][hOwned] = 1;

HouseInfo[h][hPrice] = 0;

hUpdate(h, hOwnerx);

//hUpdate(h, hOwnedx);

//hUpdate(h, hPricex);

hUpdate(h, hLockx);

hUpdate(h, hStoragex);

GivePlayerCash(playerid, -HouseInfo[h][hValue]);

                    SendClientMessage(playerid, COLOR_WHITE, " ");

                    SendClientMessage(playerid, COLOR_WHITE, " ");

                    SendClientMessage(playerid, COLOR_WHITE, " ");

                    SendClientMessage(playerid, COLOR_WHITE, " ");

                    SendClientMessage(playerid, COLOR_WHITE, " ");

                    SendClientMessage(playerid, COLOR_WHITE, " ");

                    SendClientMessage(playerid, COLOR_WHITE, " ");

SendClientMessage(playerid, -1, "{DC0C0C}Info: {FFFFFF}Felicitari pentru noua achizitie!");

SendClientMessage(playerid, -1, "{DC0C0C}Info: {FFFFFF}Casa ti-a fost inchisa automat.");

SendClientMessage(playerid, COLOR_WHITE, " ");

                    SendClientMessage(playerid, -1, "{DC0C0C}Info: {FFFFFF}Poti folosi /housemenu pentru a modera informatiile casei.");

TogglePlayerControllable(playerid, true);

Houses[playerid] ++;

SetPlayerInterior(playerid, HouseInfo[h][hInt]);

        SetPlayerPos(playerid, HouseInfo[h][hPosX1], HouseInfo[h][hPosY1], HouseInfo[h][hPosZ1]);

        SetPlayerVirtualWorld(playerid, h);

        if(PlayerToPoint(3.0, playerid, 2282.9983, -1139.7643, 1050.8984))

        {

            format(string, sizeof(string), "Apartamentul lui %s", pName(playerid));

strmid(HouseInfo[h][hName], string, 0, 100, 100);

        }

                    hUpdate(h, hNamex);

SavePHouse(h);

printf("=- House ID: %i got bought by: %s -=", h, pName(playerid));

HouseRequested[playerid] = 0;

return 1;

}

else return SendClientMessage(playerid, COLOR_RED, "{DC0C0C}Casa: {FFFFFF}Nu ai destui bani!");

}

else return SendClientMessage(playerid, COLOR_RED, "{DC0C0C}Casa: {FFFFFF}Aceasta casa nu este de vanzare!");

    }

    else { HouseRequested[playerid] = 0; return 1; }

}

if(dialogid == 305)

{

    if(response)

    {

        if(PlayerInfo[playerid][pPhousekey] != 255) return SendClientMessage(playerid, COLOR_WHITE, "{DC0C0C}Casa: {FFFFFF}Trebuie sa renunti la chirie inainte sa cumperi aceasta proprietate! (/unrentroom)");

        new h = HouseRequested[playerid];

        if(Houses[playerid] >= MAX_OWNABLE_HOUSE && PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, -1, "{DC0C0C}Casa: {FFFFFF}Ai atins limita caselor pe care le poti detine!");

if(HouseInfo[h][hOwned] == 1)

{

    if(HouseInfo[h][hPrice] <= GetPlayerCash(playerid))

    {

        if(HouseInfo[h][hLevel] <= PlayerInfo[playerid][pLevel]) {} else return SendClientMessage(playerid, COLOR_WHITE, "{DC0C0C}Casa: {FFFFFF}Nu ai nivelul necesar!");

        //new sendername[MAX_PLAYER_NAME];

GetPlayerName(playerid, sendername, sizeof(sendername));

        new count = 999;

    for(new i = 0; i < MAX_PLAYERS; i++)

{

    //GetPlayerName(i, sendernamen, sizeof(sendernamen));

    if(strmatch(HouseInfo[h][hOwner], pName(i)))

    {

        if(gPlayerLogged != 0)

        {

        count = i;

}

//else SendClientMessage(playerid, COLOR_WHITE, "1");

    }

    //else SendClientMessage(playerid, COLOR_WHITE, "2");

}

if(count != 999)

{

    GivePlayerCash(count, HouseInfo[h][hPrice]);

    SendClientMessage(count, COLOR_WHITE, " ");

    SendClientMessage(count, COLOR_WHITE, " ");

    Houses[count] --;

    format(string, sizeof(string), "{DC0C0C}Casa: {FFFFFF}%s ti-a cumparat casa pentru $%s! Contractele s-au semnat si casa nu mai e a ta acum.", sendername, FormatNumber(HouseInfo[h][hPrice]));

    SendClientMessage(count, COLOR_WHITE, string);

}

else

{

SendClientMessage(playerid, COLOR_WHITE, "{DC0C0C}Casa: {FFFFFF}Detinatorul trebuie sa fie online!");

HouseRequested[playerid] = 0;

return 1;

}

strmid(HouseInfo[h][hOwner], pName(playerid), 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);

format(string, sizeof(string), "Proprietatea lui %s", pName(playerid));

strmid(HouseInfo[h][hName], string, 0, 100, 100);

HouseInfo[h][hLock] = 1;

HouseInfo[h][hStorage] = 0;

HouseInfo[h][hOwned] = 1;

GivePlayerCash(playerid, -HouseInfo[h][hPrice]);

    HouseInfo[h][hPrice] = 0;

    Update(h, hOwnerx);

    //Update(h, hOwnedx);

    Update(h, hLockx);

    //Update(h, hPricex);

    Update(h, hStoragex);

                    SendClientMessage(playerid, COLOR_WHITE, " ");

                    SendClientMessage(playerid, COLOR_WHITE, " ");

                    SendClientMessage(playerid, COLOR_WHITE, " ");

                    SendClientMessage(playerid, COLOR_WHITE, " ");

                    SendClientMessage(playerid, COLOR_WHITE, " ");

                    SendClientMessage(playerid, COLOR_WHITE, " ");

                    SendClientMessage(playerid, COLOR_WHITE, " ");

SendClientMessage(playerid, -1, "{DC0C0C}Info: {FFFFFF}Felicitari pentru noua achizitie!");

SendClientMessage(playerid, -1, "{DC0C0C}Info: {FFFFFF}Casa ti-a fost incuiata automat.");

SendClientMessage(playerid, COLOR_WHITE, " ");

                    SendClientMessage(playerid, -1, "{DC0C0C}Info: {FFFFFF}Poti folosi /housemenu pentru a modera informatiile casei.");

TogglePlayerControllable(playerid, true);

Houses[playerid] ++;

SetPlayerInterior(playerid, HouseInfo[h][hInt]);

        SetPlayerPos(playerid, HouseInfo[h][hPosX1], HouseInfo[h][hPosY1], HouseInfo[h][hPosZ1]);

        SetPlayerVirtualWorld(playerid, h);

        if(PlayerToPoint(3.0, playerid, 2282.9983, -1139.7643, 1050.8984))

        {

            format(string, sizeof(string), "Apartamentul lui %s", pName(playerid));

strmid(HouseInfo[h][hName], string, 0, 100, 100);

}

Update(h, hNamex);

SavePHouse(h);

printf("=- House with id: %i got bought by: %s -=", h, pName(playerid));

HouseRequested[playerid] = 0;

return 1;

}

else return SendClientMessage(playerid, COLOR_RED, "{DC0C0C}Casa: {FFFFFF}Nu ai destui bani!");

}

//else return SendClientMessage(playerid, COLOR_RED, "{DC0C0C}Casa: {FFFFFF}Aceasta casa nu este de vanzare!");

    }

    else { HouseRequested[playerid] = 0; return 1; }

}[/pawn]

[pawn] for(new i = 0; i < MAX_HOUSES; i++)

{

    CheatTimer[playerid] = 3;

    //if(CPTimer[playerid] > 0) return 1;

    if(PlayerToPoint(1.5, playerid, HouseInfo[hPosX], HouseInfo[hPosY], HouseInfo[hPosZ]))

    {

        if(HouseInfo[hOwned] == 0)

        {

            //new string[256];

            if(GetPlayerCash(playerid) >= HouseInfo[hValue])

            {

        format(string, sizeof(string), "{F6F6F6}Vrei sa cumperi aceasta casa pentru {00BC00}$%d{F6F6F6}?", HouseInfo[hValue]);

ShowPlayerDialog(playerid, 300, DIALOG_STYLE_MSGBOX, "{00BC00}Meniul {F6F6F6}Casei", string, "Cumpara", "Pleaca");

                HouseRequested[playerid] = i;

                //CPTimer[playerid] = 3;

                }

}

else

{

    if(strmatch(HouseInfo[hOwner], pName(playerid)) || PlayerInfo[playerid][pPhousekey] == i)

    {

        SetPlayerInterior(playerid, HouseInfo[hInt]);

        SetPlayerPos(playerid, HouseInfo[hPosX1], HouseInfo[hPosY1], HouseInfo[hPosZ1]);

        SetPlayerVirtualWorld(playerid, i);

        EnteredHouse[playerid] = i;

        //CPTimer[playerid] = 3;

        return 1;

    }

    if(HouseInfo[hLock] == 0)

        {

    SetPlayerInterior(playerid, HouseInfo[hInt]);

    SetPlayerPos(playerid, HouseInfo[hPosX1], HouseInfo[hPosY1], HouseInfo[hPosZ1]);

    SetPlayerVirtualWorld(playerid, i);

    EnteredHouse[playerid] = i;

    }

    else if(HouseInfo[hLock] != 0 && HouseInfo[hPrice] != 0)

{

    HouseRequested[playerid] = i;

    ShowPlayerDialog(playerid, 314, DIALOG_STYLE_LIST, "{00BC00}Meniul {F6F6F6}Casei", "{00BC00}1. {F6F6F6}Cumpara casa\n{00BC00}2. {F6F6F6}Intra prin efractie", "Alege", "Iesi");

    House[playerid] = i; //return ShowPlayerDialog(playerid, 313, DIALOG_STYLE_MSGBOX, "{F6F6F6}Incuietoarea este slabita..", "{F6F6F6}Ai fortat usa dar n-ai putut sa intri.\n{F6F6F6}Sunt sanse sa poti intra in casa prin efractie. Vrei sa intri?", "Intra", "Pleaca");

}

else if(HouseInfo[hLock] != 0 && HouseInfo[hPrice] == 0)

{

    House[playerid] = i; return ShowPlayerDialog(playerid, 313, DIALOG_STYLE_MSGBOX, "{F6F6F6}Poti intra prin efractie..", "{F6F6F6}Ai incercat clanta usii si ai observat ca se poate distruge usor.\n{F6F6F6}Sunt sanse sa poti intra prin efractie. Esti sigur ca vrei sa faci asta?", "Da", "Nu");

}

}

}

}[/pawn]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.