problems.. -
Kar - 23.06.2010
Код:
cmd(flip, playerid, params[])
{
new amount, name[50];
if(!sscanf(params, "u", name, amount))
{
new State=GetPlayerState(playerid);
if (IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
if(File[playerid][Admin] >= 1)
{
new VehicleID;
GetPlayerPos(playerid, X, Y, Z);
VehicleID = GetPlayerVehicleID(playerid);
GetVehicleZAngle(VehicleID, Angle);
SetVehiclePos(VehicleID, X, Y, Z);
SetVehicleZAngle(VehicleID, Angle);
GameTextForPlayer(playerid,"~b~FLIPPED!",4000,3);
SendClientMessage(playerid, BLUE, "FLIPPED!");
else return SendClientMessage(playerid,red,"You Are Not Authorized To Use This Command");
}
else return SendClientMessage(playerid,red,"You Must Be In A Vehicle To Use This Command");
}
}
return 1;
}
why in the world do i get errors on
Код:
else return SendClientMessage(playerid,red,"You Are Not Authorized To Use This Command");
Код:
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSAN~1.PWN(1338) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSAN~1.PWN(1338) : warning 215: expression has no effect
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSAN~1.PWN(1338) : error 001: expected token: ";", but found "return"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
why does this fail
Код:
new to_others[MAX_CHATBUBBLE_LENGTH+1];
format(to_others,MAX_CHATBUBBLE_LENGTH,"%s(%d) Says: %s",text);
SetPlayerChatBubble(playerid,to_others,RED,35.0,10000);
Re: problems.. -
(SF)Noobanatior - 23.06.2010
coz you havent closed the statement b4 it it has nothing to else against
Re: problems.. -
Kar - 23.06.2010
o rofl thx. i should be ashamed-.- not to see that
Re: problems.. -
NiiRV4N4 - 23.06.2010
new to_others[MAX_CHATBUBBLE_LENGTH+1];
format(to_others,MAX_CHATBUBBLE_LENGTH,"%s(%d) Says: %s",GetPlayerName(playerid), playerid, text);
SetPlayerChatBubble(playerid,to_others,RED,35.0,10 000);
Re: problems.. -
Kar - 23.06.2010
format(to_others,MAX_CHATBUBBLE_LENGTH,"%s(%d) Says: %s",GetPlayerName(playerid), playerid, text);
i really hate this kind of warning
Код:
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSAN~1.PWN(1683) : warning 202: number of arguments does not match definition
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSAN~1.PWN(1683) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Warnings.
Re: problems.. -
NiiRV4N4 - 23.06.2010
new string[128];
format(string,sizeof(string),"%s(%d) Says: %s",GetPlayerName(playerid), playerid, text);
I don't understand... make sure you don't have string defined anywhere in the CMD or the callback or it'll give u warning.
Re: problems.. -
(SF)Noobanatior - 23.06.2010
it will say shadows at another level if you had
Re: problems.. -
Kar - 23.06.2010
yea string v shadows another level and same arguments and wtf how would that send a chat bubble D:
Код:
public OnPlayerText(playerid, text[])
{
if(CountOccurrence(text,'.')>2 && CountOccurrence(text,':')>1) {
if(!IsPlayerAdmin(playerid)) {
SendClientMessage(playerid,0xFF0000AA,"Error: We do not allow the posting of IP addresses here");
Kick(playerid);
}
return 1;
}
if(strlen(text) > 128) return 0;
new to_others[MAX_CHATBUBBLE_LENGTH+1];
format(to_others,MAX_CHATBUBBLE_LENGTH,"%s(%d) Says: %s",GetPlayerName(playerid), playerid, text);
SetPlayerChatBubble(playerid,to_others,RED,35.0,10000);
SetPVarInt(playerid,"textspam",GetPVarInt(playerid,"textspam")+1);
SetTimerEx("clearspam",5000,false,"d",playerid);
if(GetPVarInt(playerid,"textspam") == 5) {
new string[128];
new tname[MAX_PLAYER_NAME];
GetPlayerName(playerid,tname,sizeof(tname));
format(string,sizeof(string),"*SERVER KICK: %s(%d) Has Been Kicked From The Server (Reason): Excess Flood (Text Spam)", tname,playerid);
SendClientMessageToAll(PINK,string);
CallRemoteFunction("KickIncrease","d",playerid);
Kick(playerid);
}
else if(GetPVarInt(playerid,"textspam") == 4) {
SendClientMessage(playerid,red,"Stop Spamming Or You Will Be Kicked.(You Much Now Wait 5 Seconds To Type Again)");
return 0;
}
return 1;
}
Re: problems.. -
NiiRV4N4 - 23.06.2010
Here, use my OnPlayerText as an example:
pawn Код:
if (realchat)
{
if(gPlayerLogged[playerid] == 0)
{
return 0;
}
if(!IsPlayerInAnyVehicle(playerid) || IsABike(GetPlayerVehicleID(playerid)))
{
format(string, sizeof(string), "%s says: %s", GetPlayerNameEx(playerid), text);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
SetPlayerChatBubble(playerid, string, COLOR_WHITE, 20.0, 5000);
TalkLog(string);
}
else
{
if(CarWindowStatus[GetPlayerVehicleID(playerid)] == 1)
{
format(string, sizeof(string), "[Windows Closed:] %s says: %s", GetPlayerNameEx(playerid), text);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
TalkLog(string);
}
else
{
format(string, sizeof(string), "[Windows Open:] %s says: %s", GetPlayerNameEx(playerid), text);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
TalkLog(string);
}
}
return 0;
}
return 1;
}
Re: problems.. -
(SF)Noobanatior - 23.06.2010
GetPlayerName(playerid);
pyototype is GetPlayerName(playerid, const name[], len);