Duel making command problem -
GAMER_PS2 - 04.12.2011
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:
Код:
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;
}
Please help me guys
Re: Duel making command problem -
HyperZ - 04.12.2011
pawn Код:
new WeaponNames[32][] =
{
"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"
};
Re: Duel making command problem -
GAMER_PS2 - 04.12.2011
i have question how can i make my command like this
/duel >>>this is the stuff i asking for <weaponname/id>)
how can i make that?
Re: Duel making command problem -
GAMER_PS2 - 04.12.2011
dude i need help i get this error
Код:
D:\GTA San Andreas\SAMP Server\gamemodes\Stunt.pwn(764) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
and also help me if this is gonna work i need help in Giving the player/inviting guest weapon to weaponname/id
pawn Код:
CMD:acceptduel(playerid, params[])
{
new string[128],pname[MAX_PLAYER_NAME],recievername[MAX_PLAYER_NAME];
new id;
GetPlayerName(playerid,pname,sizeof(pname));
GetPlayerName(id,recievername,sizeof(recievername));
if(GetPVarInt(id,"Duel") == 1)
{
SetPVarInt(playerid,"InDuel",1);
SetPVarInt(id,"InDuel",1);
SetPVarInt(playerid,"Duel",0);
format(string,sizeof(string),"[DUEL]; %s (ID: %d) has accept your duel invite", recievername,id);
SendClientMessage(playerid,COLOR_GREEN,string);
SendClientMessage(playerid,COLOR_GREEN,"[DUEL]: The duel will start in 5 secs");
format(string,sizeof(string),"You accept %s's duel invite now the duel will start in 5 secs",pname);
SendClientMessage(id,COLOR_GREEN,string);
}
else
{
SendClientMessage(id,COLOR_RED,"No one is inviting you in duel");
}
return 1;
}
CMD:ignoreduel(playerid,params[])
{
new string[128],pname[MAX_PLAYER_NAME],recievername[MAX_PLAYER_NAME];
new id;
GetPlayerName(playerid,pname,sizeof(pname));
GetPlayerName(id,recievername,sizeof(recievername));
if(GetPVarInt(id,"Duel") == 1)
{
SetPVarInt(playerid, 0);
format(string,sizeof(string),"[DUEL]; %s (ID: %d) has ignore your duel invite", recievername,id);
SendClientMessage(playerid,COLOR_RED,string);
format(string,sizeof(string),"You ignore %s's duel invite",pname);
SendClientMessage(id,COLOR_RED,string);
}
else
{
SendClientMessage(id,COLOR_RED,"No one is inviting you in duel");
}
return 1;
}
Re: Duel making command problem -
Kostas' - 04.12.2011
It's
pawn Код:
SetPVarInt(playerid," Something Here", 0);