07.04.2017, 18:58
Ok im trying to make this event system but i want to set it so when the admin sets the weapon they can either enter the weapon id or the name so this is my coding
But i keep getting errors on two lines...
Also could someone show me how to read a specific line with y_ini?
PHP код:
new weapid,wname[50],wep,weap;
if(sscanf(params, "s[8]ii", option, wep, weap)) return SendClientMessage(playerid, error, "Usage: /eedit weapon [slot] [weaponid]");
if(wep < 1 || wep > 3) return SendClientMessage(playerid, error, "Weapon slots are between 1 and 3.");
if(IsNumeric(weap)) weapid = strval(weap); // this line has an error
else weapid = GetWeaponID(weap);// and this line as well has an error
if(weap < 1 || weap > 46) return SendClientMessage(playerid, error, "Invalid weapon ID/Name between [1-46]");
GetWeaponName(weapid, wname, sizeof(wname));
switch(wep)
{
case 1: EventWep[0] = weapid;
case 2: EventWep[1] = weapid;
case 3: EventWep[2] = weapid;
}
format(string, sizeof(string), " You have set weapon slot %d to %s.", wep, wname);
SendClientMessage(playerid, -1, string);
}
PHP код:
C:\Users\Andre'\Desktop\Andre'\samp\gamemodes\ODA.pwn(4247) : error 035: argument type mismatch (argument 1)
C:\Users\Andre'\Desktop\Andre'\samp\gamemodes\ODA.pwn(4247) : error 035: argument type mismatch (argument 1)
C:\Users\Andre'\Desktop\Andre'\samp\gamemodes\ODA.pwn(4248) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.