a /do problem -
[LSG]Lil_Familie - 10.06.2012
i have 1 error on this code
PHP код:
CMD:do(playerid, params[])
{
new str[128], name[MAX_PLAYER_NAME];
if (sscanf(params, "s[128]", str)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /do [action]");
{
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "* %s (( %s ))", params[0], name);
ProxDetector(3.5, playerid, str,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}
it says it appears in this line:
PHP код:
ProxDetector(3.5, playerid, str,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
this is the error
PHP код:
C:\Users\Patrick\Desktop\Samp scriptin\filterscripts\rp_cmds.pwn(135) : error 029: invalid expression, assumed zero
Re : a /do problem -
ricardo178 - 10.06.2012
Stop fucking bumping.......... You will be banned if you continue.
Anyways:
pawn Код:
ProxDetector(3.5, playerid, str, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
Make sure you have this in your script:
pawn Код:
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16))) // If the player is within 16 meters
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) // within 8 meters
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) //4 meters
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) //2 meters
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) //1 meter
{
SendClientMessage(i, col5, string);
}
}
else
{
SendClientMessage(i, col1, string);
}
}
}
return 1;
}
AW: a /do problem -
[LSG]Lil_Familie - 10.06.2012
always when i put this in my gamemode i cant run my server but i aint got any errors
PHP код:
CMD:o(playerid, params[])
{
new str[128], name[MAX_PLAYER_NAME];
if (sscanf(params, "s[128]", str)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /o(oc) [chat]");
{
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "[OOC] %s: %s", name, params[0]);
SendClientMessageToAll(COLOR_YELLOW, str);
}
return 1;
}
CMD:ooc(playerid, params[])
{
return cmd_o(playerid, params);
}
CMD:kill(playerid, params[])
{
SetPlayerHealth(playerid, 0);
SetPlayerArmour(playerid, 0);
}
CMD:me(playerid, params[])
{
new str[128], name[MAX_PLAYER_NAME];
if (sscanf(params, "s[128]", str)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /me [action]");
{
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "* %s: %s", name, params[0]);
ProxDetector(3.5, playerid, str,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}
CMD:do(playerid, params[])
{
new str[128], name[MAX_PLAYER_NAME];
if (sscanf(params, "s[128]", str)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /do [action]");
{
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "* %s (( %s ))", params[0], name);
ProxDetector(3.5, playerid, str,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}
CMD:b(playerid, params[])
{
new str[128], name[MAX_PLAYER_NAME];
if (sscanf(params, "s[128]", str)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /b [message]");
{
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "%s: %s", name, params[0]);
ProxDetector(3.5, playerid, str, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}
ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
{
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
}
}
}
return 1;
}
Re : a /do problem -
ricardo178 - 10.06.2012
This:
pawn Код:
CMD:do(playerid, params[])
{
new text[128], str[128], name[MAX_PLAYER_NAME];
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /do [action]");
{
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "* %s (( %s ))", text, name);
ProxDetector(3.5, playerid, str,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}
AW: a /do problem -
[LSG]Lil_Familie - 11.06.2012
okay i fixed it