04.12.2011, 07:30
i'm making my own duel system, the format of my command on my plan is /duel <id> <weaponname/id> now i have problem with some few functions on the command and i got the few following errors:
Please help me guys
Код:
D:\GTA San Andreas\SAMP Server\gamemodes\Stunt.pwn(19) : error 029: invalid expression, assumed zero D:\GTA San Andreas\SAMP Server\gamemodes\Stunt.pwn(19) : error 008: must be a constant expression; assumed zero Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
pawn Код:
//i did not include spray cans,minigun,flamethrower etc. because they are strong/weak weapons
new WeaponNames[33][] =
{
"Unarmed","Brass Knuckless","Golf Club","Nite Stick","Knife","Baseballbat",
"Shovel","Poolcue","Katana","Chainsaw","Purple Dildo","Small White Vibrator",
"Large White Vibrator","Silver Vibrator","Flowers","Cane","Grenade","Teargas",
"Molotov Cocktail","9mm","Silenced 9mm","Desert Eagle","Shotgun","Sawn-off Shotgun",
"Combatshotgun","Micro SMG","MP5","AK-47","M4","Tec9","Country Rifle","Sniper",
};
CMD:duel(playerid, params[])
{
new string[128],pname[MAX_PLAYER_NAME],recievername[MAX_PLAYER_NAME];
new weaponid[32],id;
GetPlayerName(playerid,pname,sizeof(pname));
GetPlayerName(id,recievername,sizeof(recievername));
if(sscanf(params,"ud", id,weaponid)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /duel <playername/id> <weaponname/id>");
SetPVarInt(playerid, "Duel", 1);
if(GetPVarInt(playerid,"Duel") == 1) return SendClientMessage(playerid,COLOR_RED,"You already invite a user to duel with you");
format(string,sizeof(string),"[DUEL]: %s wants duel with you with weapon %s",pname,WeaponNames);
SendClientMessage(id,COLOR_RED,string);
return 1;
}