andrein2 Posted June 20, 2013 Report Share Posted June 20, 2013 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 effectC:\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 zeroC:\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 More sharing options...
Gireada Posted June 20, 2013 Report Share Posted June 20, 2013 pune la inceputul gamemodului new SwitchKey[MAX_PLAYERS]; Link to comment Share on other sites More sharing options...
andrein2 Posted June 20, 2013 Author Report Share Posted June 20, 2013 Si mai vreau daca se poate sa ma ajuti cand intra un player sa aiba licenta de port-arma dejaSper 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 More sharing options...
Gireada Posted June 20, 2013 Report Share Posted June 20, 2013 La OnPlayerRegister pui PlayerInfo[playerid][pGunLic] = 1; Link to comment Share on other sites More sharing options...
andrein2 Posted June 20, 2013 Author Report Share Posted June 20, 2013 Vreau daca se poate sa m-a ajuti cu o comanda, am un sistem de war si vreau sa pun /sws sa se vada scoru[Gang War] Alianta americana : 1 ; Alianta Italiana : 10 ; Timp Ramas : 10 minute Link to comment Share on other sites More sharing options...
roscatu Posted June 20, 2013 Report Share Posted June 20, 2013 Posteaza la cereri scripturi Link to comment Share on other sites More sharing options...
Question
andrein2
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