Tenho 1000 kills, deveria aparecer
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 27, 500);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 34, 90);
GivePlayerWeapon(playerid, 31, 1500);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 37, 5);
Em "public OnPlayerSpawn"
DarArmas(playerid);
DarArmas(playerid)
{
if(IsPlayerConnected(playerid))
{
if(GetPlayerScore(playerid) >= 0 && GetPlayerScore(playerid) <= 30){
GivePlayerWeapon(playerid, 24, 500);
}
if(GetPlayerScore(playerid) >= 30 && GetPlayerScore(playerid) <= 80){
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 25, 500);
}
if(GetPlayerScore(playerid) >= 80 && GetPlayerScore(playerid) <= 150){
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 29, 500);
}
if(GetPlayerScore(playerid) >= 150 && GetPlayerScore(playerid) <= 230){
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 29, 500);
}
if(GetPlayerScore(playerid) >= 230 && GetPlayerScore(playerid) <= 320){
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 30, 1500);
SetPlayerArmour(playerid, 20);
}
if(GetPlayerScore(playerid) >= 320 && GetPlayerScore(playerid) <= 450){
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 31, 1500);
SetPlayerArmour(playerid, 20);
}
if(GetPlayerScore(playerid) >= 450 && GetPlayerScore(playerid) <= 700){
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 27, 500);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 31, 1500);
SetPlayerArmour(playerid, 20);
}
if(GetPlayerScore(playerid) >= 700 && GetPlayerScore(playerid) <= 1000){
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 27, 500);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 31, 1500);
SetPlayerArmour(playerid, 60);
}
if(GetPlayerScore(playerid) >= 1000 && GetPlayerScore(playerid) <= 1337){
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 27, 500);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 34, 90);
GivePlayerWeapon(playerid, 31, 1500);
SetPlayerArmour(playerid, 60);
}
if(GetPlayerScore(playerid) >= 1337 && GetPlayerScore(playerid) <= 9999999){
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 27, 500);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 34, 90);
GivePlayerWeapon(playerid, 31, 1500);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 37, 5);
}
}
return 1;
}
Spawnar pela primeira vez que vocк fala й ao player se conectar correto? Se for isso й sу o colocar DarArmas(playerid) dentro do OnPlayerConnect tambйm, e pronto ele vai spawnar com as armas coerentes ao score dele...
|
DarArmas(playerid) { if(IsPlayerConnected(playerid)) { new score = GetPlayerScore(playerid); switch(score){ case 0 .. 30:{ GivePlayerWeapon(playerid, 24, 500); } case 31 .. 80:{ GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 25, 500); } case 81 .. 150:{ GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 29, 500); } case 151 .. 230:{ GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 29, 500); } case 231 .. 320:{ GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 30, 1500); SetPlayerArmour(playerid, 20); } case 321 .. 450:{ GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 31, 1500); SetPlayerArmour(playerid, 20); } case 451 .. 700:{ GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 27, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 31, 1500); SetPlayerArmour(playerid, 20); } case 701 .. 1000:{ GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 27, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 31, 1500); SetPlayerArmour(playerid, 60); } case 1001 .. 1337:{ // Gostei da referкncia GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 27, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 34, 90); GivePlayerWeapon(playerid, 31, 1500); SetPlayerArmour(playerid, 60); } case 1337 .. 9999999:{ GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 27, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 34, 90); GivePlayerWeapon(playerid, 31, 1500); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 37, 5); } } } return 1; }
O problema й sу sintaxe.
Ao invйs de usar if, use switch: Код:
DarArmas(playerid) { if(IsPlayerConnected(playerid)) { new score = GetPlayerScore(playerid); switch(score){ case 0 .. 30:{ GivePlayerWeapon(playerid, 24, 500); } case 31 .. 80:{ GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 25, 500); } case 81 .. 150:{ GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 29, 500); } case 151 .. 230:{ GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 29, 500); } case 231 .. 320:{ GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 30, 1500); SetPlayerArmour(playerid, 20); } case 321 .. 450:{ GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 31, 1500); SetPlayerArmour(playerid, 20); } case 451 .. 700:{ GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 27, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 31, 1500); SetPlayerArmour(playerid, 20); } case 701 .. 1000:{ GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 27, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 31, 1500); SetPlayerArmour(playerid, 60); } case 1001 .. 1337:{ // Gostei da referкncia GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 27, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 34, 90); GivePlayerWeapon(playerid, 31, 1500); SetPlayerArmour(playerid, 60); } case 1337 .. 9999999:{ GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 27, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 34, 90); GivePlayerWeapon(playerid, 31, 1500); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 37, 5); } } } return 1; } Obs2: Ctrl C, Ctrl V aqui no fуrum faz a identaзгo ficar louca. Quando for migrar para o seu cуdigo, arrume os erros, por favor |
case 1337 .. 9999999:{
// Depois de case 1001 .. 1337 default:{ // isto quer dizer que se nenhuma das alternativas acima estiver correta, execute isto GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 27, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 34, 90); GivePlayerWeapon(playerid, 31, 1500); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 37, 5); }
DarArmas(playerid)
{
if(IsPlayerConnected(playerid))
{
new score = GetPlayerScore(playerid); //
switch(score){
case 0 .. 30:{
GivePlayerWeapon(playerid, 24, 500);
}
case 31 .. 80:{
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 25, 500);
}
case 81 .. 150:{
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 29, 500);
}
case 151 .. 230:{
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 29, 500);
}
case 231 .. 320:{
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 30, 1500);
SetPlayerArmour(playerid, 20);
}
case 321 .. 450:{
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 31, 1500);
SetPlayerArmour(playerid, 20);
}
case 451 .. 700:{
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 27, 500);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 31, 1500);
SetPlayerArmour(playerid, 20);
}
case 701 .. 1000:{
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 27, 500);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 31, 1500);
SetPlayerArmour(playerid, 60);
}
case 1001 .. 1337:{ // Gostei da referкncia
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 27, 500);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 34, 90);
GivePlayerWeapon(playerid, 31, 1500);
SetPlayerArmour(playerid, 60);
}
case 1338 .. 9999:{
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 27, 500);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 34, 90);
GivePlayerWeapon(playerid, 31, 1500);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 37, 5);
}
default:
{
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 27, 500);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 34, 90);
GivePlayerWeapon(playerid, 31, 1500);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 37, 5);
}
}
}
return 1;
}
forward DarArmas(playerid); public DarArmas(playerid){ // Cole o cуdigo aqui } public OnPlayerSpawn(playerid){ SetTimerEx("DarArmas", 500, false, "d", playerid); return 1; }
public OnPlayerSpawn(playerid) { GivePlayerWeapons(playerid); return 1; } stock GivePlayerWeapons(playerid) { new score = GetPlayerScore(playerid); switch(score){ case 0 .. 30: { GivePlayerWeapon(playerid, 24, 500); } case 31 .. 80: { GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 25, 500); } case 81 .. 150: { GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 29, 500); } case 151 .. 230: { GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 29, 500); } case 231 .. 320: { GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 30, 1500); SetPlayerArmour(playerid, 20); } case 321 .. 450: { GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 31, 1500); SetPlayerArmour(playerid, 20); } case 451 .. 700: { GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 27, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 31, 1500); SetPlayerArmour(playerid, 20); } case 701 .. 1000: { GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 27, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 31, 1500); SetPlayerArmour(playerid, 60); } case 1001 .. 1337: { GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 27, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 34, 90); GivePlayerWeapon(playerid, 31, 1500); SetPlayerArmour(playerid, 60); } default: { GivePlayerWeapon(playerid, 24, 500); GivePlayerWeapon(playerid, 27, 500); GivePlayerWeapon(playerid, 29, 500); GivePlayerWeapon(playerid, 34, 90); GivePlayerWeapon(playerid, 31, 1500); SetPlayerArmour(playerid, 100); GivePlayerWeapon(playerid, 37, 5); } } }