CMD:bazooka(playerid, params[]) { if (Bazooka[playerid] == 1) { GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~r~ ЎBAZOOKA EN USO!",10000,3); new weapons[13][2]; for (new i = 0; i <= 12; i++) { GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]); } ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid,35,5); SetTimerEx("TiempoBazooka", 20000, false, "i", playerid); for(new i = 0; i < MAX_PLAYERS; i++) PlayerPlaySound(i, 6400, 0.0, 0.0, 0.0); } else { PlayerPlaySound(playerid,1140,0.0,0.0,0.0); SendClientMessage(playerid, Rojo, "[ERROR]{FFFFFF} No tienes ninguna minigun para usar."); } return 1; } forward TiempoBazooka(playerid); public TiempoBazooka(playerid) { ResetPlayerWeapons(playerid); GivePlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]); Bazooka[playerid] = 0; }
new Bazooka[MAX_PLAYERS]; // global new weapons[MAX_PLAYERS][13][2]; // global CMD:bazooka(playerid, params[]) { if (Bazooka[playerid] == 1) { GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~r~ ЎBAZOOKA EN USO!",10000,3); for (new i = 0; i <= 12; i++) { GetPlayerWeaponData(playerid, i, weapons[playerid][i][0], weapons[playerid][i][1]); } ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid,35,5); SetTimerEx("TiempoBazooka", 20000, false, "i", playerid); for(new i = 0; i < MAX_PLAYERS; i++) PlayerPlaySound(i, 6400, 0.0, 0.0, 0.0); } else { PlayerPlaySound(playerid,1140,0.0,0.0,0.0); SendClientMessage(playerid, rojo, "[ERROR]{FFFFFF} No tienes ninguna minigun para usar."); } return 1; } forward TiempoBazooka(playerid); public TiempoBazooka(playerid) { ResetPlayerWeapons(playerid); for(new i = 0; i < sizeof weapons; i ++) GivePlayerWeapon(playerid, weapons[playerid][i][0], weapons[playerid][i][1]); Bazooka[playerid] = 0; }
Try
Код:
new Bazooka[MAX_PLAYERS]; // global new weapons[MAX_PLAYERS][13][2]; // global CMD:bazooka(playerid, params[]) { if (Bazooka[playerid] == 1) { GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~r~ ЎBAZOOKA EN USO!",10000,3); for (new i = 0; i <= 12; i++) { GetPlayerWeaponData(playerid, i, weapons[playerid][i][0], weapons[playerid][i][1]); } ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid,35,5); SetTimerEx("TiempoBazooka", 20000, false, "i", playerid); for(new i = 0; i < MAX_PLAYERS; i++) PlayerPlaySound(i, 6400, 0.0, 0.0, 0.0); } else { PlayerPlaySound(playerid,1140,0.0,0.0,0.0); SendClientMessage(playerid, rojo, "[ERROR]{FFFFFF} No tienes ninguna minigun para usar."); } return 1; } forward TiempoBazooka(playerid); public TiempoBazooka(playerid) { ResetPlayerWeapons(playerid); for(new i = 0; i < sizeof weapons; i ++) GivePlayerWeapon(playerid, weapons[playerid][i][0], weapons[playerid][i][1]); Bazooka[playerid] = 0; } |
C:\Users\Usuario\Desktop\Batalla de Contrabando\gamemodes\CounterStrike.pwn(2790) : error 017: undefined symbol "weapons" C:\Users\Usuario\Desktop\Batalla de Contrabando\gamemodes\CounterStrike.pwn(2791) : error 017: undefined symbol "weapons" C:\Users\Usuario\Desktop\Batalla de Contrabando\gamemodes\CounterStrike.pwn(2791) : warning 215: expression has no effect C:\Users\Usuario\Desktop\Batalla de Contrabando\gamemodes\CounterStrike.pwn(2791) : error 001: expected token: ";", but found "]" C:\Users\Usuario\Desktop\Batalla de Contrabando\gamemodes\CounterStrike.pwn(2791) : error 029: invalid expression, assumed zero C:\Users\Usuario\Desktop\Batalla de Contrabando\gamemodes\CounterStrike.pwn(2791) : fatal error 107: too many error messages on one line
forward TiempoBazooka(playerid); public TiempoBazooka(playerid) { ResetPlayerWeapons(playerid); for(new i = 0; i < sizeof weapons; i ++) //line 2790 GivePlayerWeapon(playerid, weapons[playerid][i][0], weapons[playerid][i][1]); //2791 Bazooka[playerid] = 0; }
Yes thanks, works correctly, but it will work with other killstreaks like minigun? donґt need to make new variable?
Can you help me how to give back the player weapons if the killstreak ammo get over? |
Try
Код:
new Bazooka[MAX_PLAYERS]; // global new weapons[MAX_PLAYERS][13][2]; // global CMD:bazooka(playerid, params[]) { if (Bazooka[playerid] == 1) { GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~r~ ЎBAZOOKA EN USO!",10000,3); for (new i = 0; i <= 12; i++) { GetPlayerWeaponData(playerid, i, weapons[playerid][i][0], weapons[playerid][i][1]); } ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid,35,5); SetTimerEx("TiempoBazooka", 20000, false, "i", playerid); for(new i = 0; i < MAX_PLAYERS; i++) PlayerPlaySound(i, 6400, 0.0, 0.0, 0.0); } else { PlayerPlaySound(playerid,1140,0.0,0.0,0.0); SendClientMessage(playerid, rojo, "[ERROR]{FFFFFF} No tienes ninguna minigun para usar."); } return 1; } forward TiempoBazooka(playerid); public TiempoBazooka(playerid) { ResetPlayerWeapons(playerid); for(new i = 0; i < sizeof weapons; i ++) GivePlayerWeapon(playerid, weapons[playerid][i][0], weapons[playerid][i][1]); Bazooka[playerid] = 0; } |
Espaсol and better! haha
I am Brazilian and I can understand better. |
new Bazooka[MAX_PLAYERS]; // global new weapons[MAX_PLAYERS][13][2]; // global new TimerBz[MAX_PLAYERS]; CMD:bazooka(playerid, params[]) { if(Bazooka[playerid] == 1) { GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~r~ ЎBAZOOKA EN USO!",10000,3); for (new i = 0; i <= 12; i++) { GetPlayerWeaponData(playerid, i, weapons[playerid][i][0], weapons[playerid][i][1]); } ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid,35,5); TimerBz[playerid] = SetTimerEx("TiempoBazooka", 20000, false, "i", playerid); for(new i = 0; i < MAX_PLAYERS; i++) PlayerPlaySound(i, 6400, 0.0, 0.0, 0.0); } else { PlayerPlaySound(playerid,1140,0.0,0.0,0.0); SendClientMessage(playerid, rojo, "[ERROR]{FFFFFF} No tienes ninguna minigun para usar."); } return 1; } public OnPlayerUpdate(playerid) { if(Bazooka[playerid] == 1) { new GetAmmo, GetWeapon; GetPlayerWeaponData(playerid, 7, GetWeapon, GetAmmo); if(GetAmmo < 1) return KillTimer(TimerBz[playerid]), TiempoBazooka(playerid); } return 1; } forward TiempoBazooka(playerid); public TiempoBazooka(playerid) { ResetPlayerWeapons(playerid); for(new i = 0; i < sizeof weapons; i ++) GivePlayerWeapon(playerid, weapons[playerid][i][0], weapons[playerid][i][1]); Bazooka[playerid] = 0; return 1; }