15.08.2013, 14:48
Код HTML:
CMD:createweapon(playerid,params[])
{
new material,pname[MAX_PLAYER_NAME],astring[256],ammo,weaponid,string[128];
if(sscanf(params,"ii",weaponid,ammo)) return SendClientMessage(playerid,COLOR_RED, "Usage: /createweapon [weaponid (found in /createweaponlist)] [ammo (each bullet is weapon cost /50)]");
if(weaponid > 6) return SendClientMessage(playerid,COLOR_RED, "Error: Invalid weapon id 1-6");
if(ammo < 1) return SendClientMessage(playerid,COLOR_RED, "Error:You must at least have one bullet");
if(PlayerInfo[playerid][MaterialJob] == true && weaponid == 1)) {
material = (200/50) + 200;
if(material > PlayerInfo[playerid][pMaterial]) return SendClientMessage(playerid,COLOR_RED, "You do not have enough materials for this item");
PlayerInfo[playerid][pMaterial] -= material;
GivePlayerWeapon(playerid,4,1);
format(string,128,"You have made a knife it cost you %i materials.",material);
SendClientMessage(playerid,COLOR_GREEN,string);
GetPlayerName(playerid,pname, sizeof(pname));
format(astring,256,"{F81414}System:{FF6600}%s has created a knife using %i materials he now has %d% left.",pname,material,PlayerInfo[playerid][pMaterial]);
}else if(PlayerInfo[playerid][MaterialJob] == true && weaponid == 2)) {
material = (500/50*ammo) + 500;
if(material > PlayerInfo[playerid][pMaterial) return SendClientMessage(playerid,COLOR_RED, "You do not have enough materials for this item");
PlayerInfo[playerid][pMaterial] -= material;
GivePlayerWeapon(playerid,24,ammo);
format(string,128,"You have made a Desert Eagle it cost you %i materials and has %i bullets.",material,ammo);
SendClientMessage(playerid,COLOR_GREEN,string);
GetPlayerName(playerid,pname, sizeof(pname));
format(astring,256,"{F81414}System:{FF6600}%s has created a Desert Eagle using %i materials it has %i bullets,he now has %d% left.",pname,material,ammo,PlayerInfo[playerid][pMaterial]);
}else if(PlayerInfo[playerid][MaterialJob] == true && weaponid == 3)) {
material = (1000/50*ammo) + 1000;
if(material > PlayerInfo[playerid][pMaterial]) return SendClientMessage(playerid,COLOR_RED, "You do not have enough materials for this item");
PlayerInfo[playerid][pMaterial] -= material;
GivePlayerWeapon(playerid,25,ammo);
format(string,128,"You have made a Shotgun it cost you %i materials and has %i bullets.",material,ammo);
SendClientMessage(playerid,COLOR_GREEN,string);
GetPlayerName(playerid,pname, sizeof(pname));
format(astring,256,"{F81414}System:{FF6600}%s has created a Shotgun using %i materials it has %i bullets,he now has %d% left.",pname,material,ammo,PlayerInfo[playerid][pMaterial]);
}else if(PlayerInfo[playerid][MaterialJob] == true && weaponid == 4)) {
material = (1500/50*ammo) + 1500;
if(material > PlayerInfo[playerid][pMaterial]) return SendClientMessage(playerid,COLOR_RED, "You do not have enough materials for this item");
PlayerInfo[playerid][pMaterial] -= material;
GivePlayerWeapon(playerid,29,ammo);
format(string,128,"You have made an MP5 it cost you %i materials and has %i bullets.",material,ammo);
SendClientMessage(playerid,COLOR_GREEN,string);
GetPlayerName(playerid,pname, sizeof(pname));
format(astring,256,"{F81414}System:{FF6600}%s has created an MP5 using %i materials it has %i bullets,he now has %d% left.",pname,material,ammo,PlayerInfo[playerid][pMaterial]);
}else if(PlayerInfo[playerid][MaterialJob] == true && weaponid == 5)) {
material = (2000/50*ammo) + 2000;
if(material > PlayerInfo[playerid][pMaterial]) return SendClientMessage(playerid,COLOR_RED, "You do not have enough materials for this item");
PlayerInfo[playerid][pMaterial] -= material;
GivePlayerWeapon(playerid,34,ammo);
format(string,128,"You have made a Sniper it cost you %i materials and has %i bullets.",material,ammo);
SendClientMessage(playerid,COLOR_GREEN,string);
GetPlayerName(playerid,pname, sizeof(pname));
format(astring,256,"{F81414}System:{FF6600}%s has created a Sniper using %i materials it has %i bullets,he now has %d% left.",pname,material,ammo,PlayerInfo[playerid][pMaterial]);
}else if(PlayerInfo[playerid][MaterialJob] == true && weaponid == 6)) {
material = (5000/50*ammo) + 5000;
if(material > PlayerInfo[playerid][pMaterial]) return SendClientMessage(playerid,COLOR_RED, "You do not have enough materials for this item");
PlayerInfo[playerid][pMaterial] -= material;
GivePlayerWeapon(playerid,35,ammo);
format(string,128,"You have made an RPG it cost you %i materials and has %i bullets.",material,ammo);
SendClientMessage(playerid,COLOR_GREEN,string);
GetPlayerName(playerid,pname, sizeof(pname));
format(astring,256,"{F81414}System:{FF6600}%s has created an RPG using %i materials it has %i bullets,he now has %d% left.",pname,material,ammo,PlayerInfo[playerid][pMaterial]);
}else{
SendClientMessage(playerid,COLOR_RED,"You do not have the Material Supplier job type /materialjob to receive it");
return 1;
Quote:
C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(1567) : error 029: invalid expression, assumed zero C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(1576) : error 029: invalid expression, assumed zero C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(1576) : warning 215: expression has no effect C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(1576) : error 001: expected token: ";", but found "if" C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(1576) : error 029: invalid expression, assumed zero C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(1576) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors. |
Код HTML:
if(PlayerInfo[playerid][MaterialJob] == true && weaponid == 1)) {
Код HTML:
if(PlayerInfo[playerid][MaterialJob] == true && weaponid == 2)) {