12.10.2013, 16:28
Hello i made a rape command and i get those errors
my code:
Errors:
my code:
pawn Код:
CMD:rape(playerid, params[])
{
new string[128];
new ID;
if(sscanf(params, "u", ID))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /rape (Player Name/ID)");
return 1;
}
if(AttemptedToRapeRecently[playerid] >= 1)
{
SendClientMessage(playerid,COLOR_ERROR,"Your cock is sore from the last time you tried to rape someone. Please wait before trying to rape again.");
return 1;
}
if(HasRapedRecently[playerid] >= 1)
{
SendClientMessage(playerid,COLOR_ERROR,"Your cock is still tired from the last rape. Please wait before raping again.");
return 1;
}
new crand = random(100);
if(crand <= 30)
{
SendClientMessage(playerid,COLOR_ERROR,"Rape attempt failed. The player slipped out of your grasp.");
AttemptedToRapeRecently[playerid] =25;
return 1;
}
if(GetDistanceBetweenPlayers(playerid,ID) <= 4 && crand > 30)
{
if(gTeam[playerid] == TEAM_RAPIST && gTeam[ID] != TEAM_COP)
{
SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_Player Raped_]]");
format(string,sizeof(string),"You have grabbed %s(%d) and raped them! They have been infected with an STI.",GetName(ID),ID);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
IncreasePlayerScore(playerid,2);
HasRapedRecently[playerid] =120;
SendClientMessage(ID,COLOR_DEADCONNECT,"[[_Raped_]]");
format(string,sizeof(string),"%s(%d) has grabbed you and raped you! You have been infected with an STI.",GetName(playerid),playerid);
SendClientMessage(ID,COLOR_LIGHTBLUE,string);
HasSTI[ID] =1;
IncreaseWantedLevel(playerid,4);
format(string,sizeof(string),"[RAPE] %s(%d) has grabbed %s(%d) and raped them. They are now infected with an STI.",GetName(playerid),playerid,PlayerName(ID),ID);
SendClientMessageToAll(COLOR_ROYALBLUE,string);
format(string,sizeof(string),"11[RAPE] %s(%d) has grabbed %s(%d) and raped them. They are now infected with an STI.",GetName(playerid),playerid,PlayerName(ID),ID);
SendClientMessageToAll(COLOR_ROYALBLUE,string);
return 1;
}
}
return 1;
}
Код:
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(1210) : error 017: undefined symbol "AttemptedToRapeRecently" C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(1210) : warning 215: expression has no effect C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(1210) : error 001: expected token: ";", but found "]" C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(1210) : error 029: invalid expression, assumed zero C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CNR.pwn(1210) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.