Jump to content
  • 0

Problema /givekey


andrein2

Question

Buna ziua am si eu o problema am acest cod

[pawn] if(strcmp(cmd, "/switchkey", true) == 0)

{

    if(IsPlayerConnected(playerid))

{

if(!SwitchKey[playerid])

{

if(HireCar[playerid] != 399)

{

SwitchKey[playerid] = 1;

GameTextForPlayer(playerid, "~w~You control now your house car", 5000, 6);

}

else

{

GameTextForPlayer(playerid, "~w~You do not hire a car", 5000, 6);

}

return 1;

}

else

{

SwitchKey[playerid] = 0;

GameTextForPlayer(playerid, "~w~You control now your hire car", 5000, 6);

}

}

return 1;

}

if(strcmp(cmd, "/givekey", true) == 0)

{

    if(IsPlayerConnected(playerid))

{

tmp = strtok(cmdtext, idx);

new car;

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "{00FF00}Folosire:{FFFFFF} /givekey [playerid/numejucator]");

return 1;

}

giveplayerid = ReturnUser(tmp);

if(HireCar[playerid] == 299 && PlayerInfo[playerid][pPhousekey] == 255)

{

SendClientMessage(playerid, COLOR_GRAD1, "  You dont have a key to give");

return 1;

}

else

  {

if(HireCar[playerid] != 299 && SwitchKey[playerid] == 0)

{

car = HireCar[playerid];

gCarLock[car] = 0;

UnLockCar(car);

HireCar[playerid] = 299;

}

else

{

car = PlayerInfo[playerid][pPhousekey]+1;

}

}

if (IsPlayerConnected(giveplayerid))

{

    if(giveplayerid != INVALID_PLAYER_ID)

    {

if(ProxDetectorS(5.0, playerid, giveplayerid))

{

if(HireCar[giveplayerid] != 299)

{

gCarLock[HireCar[giveplayerid]] = 0;

UnLockCar(HireCar[giveplayerid]);

}

HireCar[giveplayerid] = car;

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

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

format(string, sizeof(string), "  You have given %s the key to your vehicle", giveplayer);

PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

SendClientMessage(playerid, COLOR_GRAD1, string);

format(string, sizeof(string), "  You have recieved the key to a vehicle from %s", sendername);

SendClientMessage(giveplayerid, COLOR_GRAD1, string);

format(string, sizeof(string), "* %s takes out a set of keys, and tosses them to %s.", sendername ,giveplayer);

ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

}

}

}

}

return 1;[/pawn]

Si cand dau compile imi da aceste erori

[pawn]C:\Users\Razvan\Desktop\Game4Win RolePlay\gamemodes\G4W.pwn(39559) : error 017: undefined symbol "SwitchKey"

C:\Users\Razvan\Desktop\Game4Win RolePlay\gamemodes\G4W.pwn(39559) : warning 215: expression has no effect

C:\Users\Razvan\Desktop\Game4Win RolePlay\gamemodes\G4W.pwn(39559) : error 001: expected token: ";", but found "]"

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

C:\Users\Razvan\Desktop\Game4Win RolePlay\gamemodes\G4W.pwn(39559) : fatal error 107: too many error messages on one line[/pawn]

Va rog ajutatima

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Si mai vreau daca se poate sa ma ajuti cand intra un player sa aiba licenta de port-arma deja

Sper sa te ajute codu acesta

[pawn] if(strcmp(cmd,"/licenses",true)==0)

    {

        if(IsPlayerConnected(playerid))

    {

        new text1[20];

        new text2[20];

        new text3[20];

        new text4[20];

        new text5[20];

        if(PlayerInfo[playerid][pCarLic]) { text1 = "Passed"; } else { text1 = "Not Passed"; }

            if(PlayerInfo[playerid][pFlyLic]) { text4 = "Passed"; } else { text4 = "Not Passed"; }

if(PlayerInfo[playerid][pBoatLic]) { text2 = "Passed"; } else { text2 = "Not Passed"; }

        if(PlayerInfo[playerid][pFishLic]) { text3 = "Passed"; } else { text3 = "Not Passed"; }

        if(PlayerInfo[playerid][pGunLic]) { text5 = "Passed"; } else { text5 = "Not Passed"; }

        SendClientMessage(playerid, COLOR_WHITE, "|__________________ Licenses __________________|");

        format(string, sizeof(string), "** Drivers License: %s.", text1);

SendClientMessage(playerid, COLOR_GREY, string);

format(string, sizeof(string), "** Flying License: %s.", text4);

SendClientMessage(playerid, COLOR_GREY, string);

format(string, sizeof(string), "** Sailing License: %s.", text2);

SendClientMessage(playerid, COLOR_GREY, string);

format(string, sizeof(string), "** Fishing License: %s.", text3);

SendClientMessage(playerid, COLOR_GREY, string);

format(string, sizeof(string), "** Weapon License: %s.", text5);

SendClientMessage(playerid, COLOR_GREY, string);

SendClientMessage(playerid, COLOR_WHITE, "|______________________________________________|");

}

    return 1;

}[/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.