26.05.2013, 02:57
i was makeing a anti repeat system
so that a player can say the same line twice and not more than that in every 5 seconds
i know that i have done some basic things worng even the declaration but it was done to do things
i am not good regards to wroking with string so maybe you guys can help me
codes:
errors:
so that a player can say the same line twice and not more than that in every 5 seconds
i know that i have done some basic things worng even the declaration but it was done to do things
i am not good regards to wroking with string so maybe you guys can help me
codes:
pawn Код:
new sstring[MAX_PLAYERS][128],stoped[MAX_PLAYERS],muted[MAX_PLAYERS];
public OnPlayerText(playerid, text[])
{
if((stoped[playerid])<2&&(muted[playerid])==0)
{
if(strval(text) == ContestAnswer && ContestAnswer != -1) // Checks if the text the player has typed is equal to the Contest Answer, but isn't -1.
{
OnPlayerWinContest(playerid); // This'll direct the script to the OnPlayerWinContest callback.
}
if(strcmp(sstring[playerid][],text,true,sizeof((text)))!=0){
strmid(sstring, text, 0,(sizeof(text)-1)); //sstring[playerid]=text[sizeof(text)];
stoped=0;
}
else{
stoped++;
SendClientMessage(playerid,COLOR_ERROR,"Plese Dont Repeat your self again and again.");
}
}
else if(stoped[playerid]>1)
{
SetTimer("Unmute(playerid)",5000,0);
}
else if(muted[playerid]==1)
{
SetTimer("Unmute(playerid)",60000,0);
}
return 1;
}
public Unmute(playerid)
{
if(stoped[playerid]>2)
{
stoped--;
}else if(muted[playerid]){
muted =0;
}
return 1;
}
pawn Код:
G:\C\samp03x_svr_R1-2_win32\gamemodes\now.pwn(5397) : error 029: invalid expression, assumed zero
G:\C\samp03x_svr_R1-2_win32\gamemodes\now.pwn(5397) : warning 224: indeterminate array size in "sizeof" expression (symbol "")
G:\C\samp03x_svr_R1-2_win32\gamemodes\now.pwn(5398) : error 048: array dimensions do not match
G:\C\samp03x_svr_R1-2_win32\gamemodes\now.pwn(5398) : warning 224: indeterminate array size in "sizeof" expression (symbol "")
G:\C\samp03x_svr_R1-2_win32\gamemodes\now.pwn(5399) : error 033: array must be indexed (variable "stoped")
G:\C\samp03x_svr_R1-2_win32\gamemodes\now.pwn(5402) : error 022: must be lvalue (non-constant)
G:\C\samp03x_svr_R1-2_win32\gamemodes\now.pwn(5402) : warning 215: expression has no effect
G:\C\samp03x_svr_R1-2_win32\gamemodes\now.pwn(5416) : warning 235: public function lacks forward declaration (symbol "Unmute")
G:\C\samp03x_svr_R1-2_win32\gamemodes\now.pwn(5420) : error 022: must be lvalue (non-constant)
G:\C\samp03x_svr_R1-2_win32\gamemodes\now.pwn(5420) : warning 215: expression has no effect
G:\C\samp03x_svr_R1-2_win32\gamemodes\now.pwn(5423) : warning 209: function "Unmute" should return a value
G:\C\samp03x_svr_R1-2_win32\gamemodes\now.pwn(6568) : warning 203: symbol is never used: "Timer"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.