02.05.2013, 20:17
Ok, since you guys are just lovely helpers, i'm back =3
So long story short, i've been having issues with the /order command for my servers script. Someone else put together a base version for a new one, which didn't go so well, and odds are we've both missed something. Here's the list of warnings / errors and the code. What'd we do wrong here? :S
So long story short, i've been having issues with the /order command for my servers script. Someone else put together a base version for a new one, which didn't go so well, and odds are we've both missed something. Here's the list of warnings / errors and the code. What'd we do wrong here? :S
Код:
(7850) : warning 219: local variable "string" shadows a variable at a preceding level (7858) : warning 219: local variable "string" shadows a variable at a preceding level (7866) : warning 219: local variable "string" shadows a variable at a preceding level (7874) : warning 219: local variable "string" shadows a variable at a preceding level (7882) : warning 219: local variable "string" shadows a variable at a preceding level (7890) : warning 219: local variable "string" shadows a variable at a preceding level (7898) : warning 219: local variable "string" shadows a variable at a preceding level (7906) : warning 219: local variable "string" shadows a variable at a preceding level (7914) : warning 219: local variable "string" shadows a variable at a preceding level (71585) : error 027: invalid character constant (71585) : error 027: invalid character constant
Код:
if(strcmp(cmd,"/order", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 8.0, 1415.5883,-1300.2175,13.5450))
{
ShowPlayerDialog(playerid, 320, DIALOG_STYLE_LIST,"{FFFFFF}Hitman Agency","9mm\nDesert Eagle\nM4\nAk47\nSniper\Shotgun\nSpas12\nSilenced Pistol\nKnife\nC4\nDetonator","Submit","Cancel");
return 1;
}
}
Код:
if(dialogid == 320)//This is the Hitman Weapons
{
if(response)
{
switch(listitem)
{
case 0:
{
new string[128];
GivePlayerWeapon(playerid, 22, 100);
format(string,sizeof(string),"* %s takes a 9mm from the dumpster and stashes it.",PlayerName(playerid));
ProxDetector(8.0, playerid, string,PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
return 1;
}
case 1:
{
new string[128];
GivePlayerWeapon(playerid, 24, 100);
format(string,sizeof(string), "* %s takes a Desert Eagle from the dumpster and stashes it.",PlayerName(playerid));
ProxDetector(8.0, playerid, string,PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
return 1;
}
case 2:
{
new string[128];
GivePlayerWeapon(playerid, 31, 600);
format(string,sizeof(string), "* %s takes a M4 from the dumpster and stashes it.",PlayerName(playerid));
ProxDetector(8.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
return 1;
}
case 3:
{
new string[128];
GivePlayerWeapon(playerid, 30, 600);
format(string,sizeof(string), "* %s takes a AK-47 from the dumpster and stashes it.",PlayerName(playerid));
ProxDetector(8.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
return 1;
}
case 4:
{
new string[128];
GivePlayerWeapon(playerid, 34, 200);
format(string,sizeof(string), "* %s takes a Sniper from the dumpster and stashes it.",PlayerName(playerid));
ProxDetector(8.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
return 1;
}
case 5:
{
new string[128];
GivePlayerWeapon(playerid, 25, 200);
format(string,sizeof(string), "* %s takes a Shotgun from the dumpster and stashes it.",PlayerName(playerid));
ProxDetector(8.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
return 1;
}
case 6:
{
new string[128];
GivePlayerWeapon(playerid, 27, 250);
format(string,sizeof(string), "* %s takes a Spaz-12 from the dumpster and stashes it.",PlayerName(playerid));
ProxDetector(8.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
return 1;
}
case 7:
{
new string[128];
GivePlayerWeapon(playerid, 23, 200);
format(string,sizeof(string), "* %s takes a Silenced Pistol from the dumpster and stashes it.",PlayerName(playerid));
ProxDetector(8.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
return 1;
}
case 8:
{
new string[128];
GivePlayerWeapon(playerid, 4, 2);
format(string,sizeof(string), "* %s takes a Knife from the dumpster and stashes it.",PlayerName(playerid));
ProxDetector(8.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
return 1;
}
case 9:
{
new string[128];
GivePlayerWeapon(playerid, 39, 5);
format(string,sizeof(string), "* %s takes a C4 from the dumpster and stashes it.",PlayerName(playerid));
ProxDetector(8.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
return 1;
}
case 10:
{
new string[128];
GivePlayerWeapon(playerid, 40, 1);
format(string,sizeof(string), "* %s takes a detonator from the dumpster and stashes it.",PlayerName(playerid));
ProxDetector(8.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
return 1;
}
}
}
}

