new RandomWeapons[] =
{
24,
27,
29,
31,
4
};
public OnPlayerSpawn(playerid)
{
GivePlayerWeapon(playerid, RandomWeapons[random(sizeof(RandomWeapons))], 500);
GivePlayerWeapon(playerid, RandomWeapons[random(sizeof(RandomWeapons))], 500);
GivePlayerWeapon(playerid, RandomWeapons[random(sizeof(RandomWeapons))], 500);
}
return 1;
}
new RandomWeapons[5] =
{
24,
27,
29,
31,
4
};
pawn Код:
|
public OnPlayerSpawn(playerid)
{
GivePlayerWeapon(playerid, RandomWeapons[random(sizeof(RandomWeapons))], 500);
GivePlayerWeapon(playerid, RandomWeapons[random(sizeof(RandomWeapons))], 500);
GivePlayerWeapon(playerid, RandomWeapons[random(sizeof(RandomWeapons))], 500);
return 1;
}
public OnPlayerSpawn(playerid)
{
GivePlayerWeapon(playerid, RandomWeapons, 500);
GivePlayerWeapon(playerid, RandomWeapons, 500);
GivePlayerWeapon(playerid, RandomWeapons, 500);
return 1;
}
stock giverandomweap(playerid)
{
new RandomWeapons = random(5);
switch(RandomWeapons)
{
case 0: return GivePlayerWeapon(playerid, 24, 500);
case 1: return GivePlayerWeapon(playerid, 27, 500);
case 3: return GivePlayerWeapon(playerid, 29, 500);
case 4: return GivePlayerWeapon(playerid, 31, 500);
case 5: return GivePlayerWeapon(playerid, 4, 1); // you can't have more than 1 knife
}
return 1;
}
public OnPlayerSpawn(playerid)
{
giverandomweap(playerid);
giverandomweap(playerid);
giverandomweap(playerid);
return 1;
}
stock giverandompistol(playerid)
{
new RandomWeapons = random(3);
switch(RandomWeapons)
{
case 0: return GivePlayerWeapon(playerid, 24, 150);
case 1: return GivePlayerWeapon(playerid, 23, 250);
case 2: return GivePlayerWeapon(playerid, 22, 350);
}
return 1;
}
stock giverandomshotty(playerid)
{
new RandomWeapons = random(3);
switch(RandomWeapons)
{
case 0: return GivePlayerWeapon(playerid, 25, 300);
case 1: return GivePlayerWeapon(playerid, 27, 200);
case 2: return GivePlayerWeapon(playerid, 26, 100);
}
return 1;
}
stock giverandomsmg(playerid)
{
new RandomWeapons = random(3);
switch(RandomWeapons)
{
case 0: return GivePlayerWeapon(playerid, 28, 500);
case 1: return GivePlayerWeapon(playerid, 32, 500);
case 2: return GivePlayerWeapon(playerid, 29, 500);
}
return 1;
}
stock giverandomrifle(playerid)
{
new RandomWeapons = random(4);
switch(RandomWeapons)
{
case 0: return GivePlayerWeapon(playerid, 34, 75);
case 1: return GivePlayerWeapon(playerid, 33, 200);
case 2: return GivePlayerWeapon(playerid, 30, 300);
case 3: return GivePlayerWeapon(playerid, 31, 250);
}
return 1;
}
stock giverandommelee(playerid)
{
new RandomWeapons = random(15);
switch(RandomWeapons)
{
case 0: return GivePlayerWeapon(playerid, 1, 1);
case 1: return GivePlayerWeapon(playerid, 2, 1);
case 2: return GivePlayerWeapon(playerid, 3, 1);
case 3: return GivePlayerWeapon(playerid, 4, 1);
case 4: return GivePlayerWeapon(playerid, 5, 1);
case 5: return GivePlayerWeapon(playerid, 6, 1);
case 6: return GivePlayerWeapon(playerid, 7, 1);
case 7: return GivePlayerWeapon(playerid, 8, 1);
case 8: return GivePlayerWeapon(playerid, 9, 1);
case 9: return GivePlayerWeapon(playerid, 10, 1);
case 10: return GivePlayerWeapon(playerid, 11, 1);
case 11: return GivePlayerWeapon(playerid, 12, 1);
case 12: return GivePlayerWeapon(playerid, 13, 1);
case 13: return GivePlayerWeapon(playerid, 14, 1);
case 14: return GivePlayerWeapon(playerid, 15, 1);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
giverandompistol(playerid);
giverandomshotty(playerid);
giverandomsmg(playerid);
giverandomrifle(playerid);
giverandommelee(playerid);
return 1;
}
Actually, what does it do, not giving weapon, always weapon 24(Deagle), or what, same problem that you mentioned.
Could you try to translate it in different words, I don't really understand when you say: When I died instantly created i only get a pistol and here the codes: - can you tell me what is the problem ? |
pawn Код:
pawn Код:
|
C:\Documents and Settings\User\Desktop\FXP отшлеъ м\TeamWar.pwn(154) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\User\Desktop\FXP отшлеъ м\TeamWar.pwn(155) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\User\Desktop\FXP отшлеъ м\TeamWar.pwn(156) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
I think that it is giving you pistol every time because it is the first weapon you listed.
I tested this and it works, but it is still possible to get the same weapon more than once. I don't know how to make it give 3 different weapons every time PHP код:
go ahead and use this if you want: PHP код:
|
Maybe you have some problems in this coding thing
24, bla, bla, bla should'nt there be ; |
I tested both of those scripts I posted and they both work.
Maybe you are putting them both together? Only use one of them. |