28.12.2012, 12:37
Hey, I have a problem, I have the x, y, z for my OnPlayerKeyStateChange and I have the Y to for year, for my report system. It give's errors, How can I use the letter y, two times for two different things?
new bool:jumper[MAX_PLAYERS];
new Float:x,Float:y,Float:z;
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_CROUCH && GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && spectatorid[playerid] != INVALID_PLAYER_ID)
{
AdvanceSpectate(playerid);
}
else if(newkeys & KEY_JUMP && GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && spectatorid[playerid] != INVALID_PLAYER_ID)
{
ReverseSpectate(playerid);
}
if(PRESSED(KEY_JUMP) && jumper[playerid] == true){
GetPlayerVelocity(playerid, x, y, z);
SetPlayerVelocity(playerid, x, y, z+ 0.3);}
return 1;
}
CMD:report(playerid, params[])
{
new str[128], id, reason[128], msg[356], hs, ms, sec, y, m, d, ip[16];
if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_ORANGE, "You must be type /report (id) (reason)");
if(id == INVALID_PLAYER_ID) return ErrorMessages(playerid, 2);
if(id == playerid) return ErrorMessages(playerid, 4);
if(PlayerAcc[playerid][Admin] < PlayerAcc[id][Admin]) return ErrorMessages(playerid, 3);
if(sscanf(params, "us[30]", id, reason)) return SendClientMessage(playerid, COLOR_ORANGE, "You must be type /report [playerid] [reason]");
getdate(y, m, d);
gettime(hs, ms, sec);
GetPlayerIp(id, ip, sizeof(ip));
ServerInfo[ReporterName] = GetName(playerid);
ServerInfo[TargetName] = GetName(id);
ServerInfo[Reason] = reason;
ServerInfo[H] = hs;
ServerInfo[M] = ms;
ServerInfo[S] = sec;
format(str, sizeof(str), "PLANETS ADMIN REPORTS: %s(ID:%d) has reported %s(ID:%d) (Reason: %s)", GetName(playerid), playerid, GetName(id), id, reason);
SendMessageToAdmin(COLOR_BROWN, str);
SendClientMessage(playerid, COLOR_LIME, "Your report has been sended to the Online Admins!");
format(msg, sizeof(msg), "Player %s(ID:%d) has reported %s(ID:%d) (Reason: %s) [Reported Player IP: %s]", m, d, y, hs, ms, sec, GetName(playerid), playerid, GetName(id), id, reason, ip);
SaveIn("reports", msg);
return 1;
}
F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(147 : warning 219: local variable "y" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(1737) : warning 204: symbol is assigned a value that is never used: "str" F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(174 : warning 204: symbol is assigned a value that is never used: "str" F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2064) : warning 219: local variable "x" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2064) : warning 219: local variable "y" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2064) : warning 219: local variable "z" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2094) : warning 219: local variable "x" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2094) : warning 219: local variable "y" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2094) : warning 219: local variable "z" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2117) : warning 219: local variable "x" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2117) : warning 219: local variable "y" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2117) : warning 219: local variable "z" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2245) : warning 219: local variable "x" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2245) : warning 219: local variable "y" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2245) : warning 219: local variable "z" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2299) : warning 219: local variable "x" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2299) : warning 219: local variable "y" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2299) : warning 219: local variable "z" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2557) : warning 219: local variable "x" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2557) : warning 219: local variable "y" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2557) : warning 219: local variable "z" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2837) : warning 219: local variable "x" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2837) : warning 219: local variable "y" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2837) : warning 219: local variable "z" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2899) : warning 219: local variable "x" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2899) : warning 219: local variable "y" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2899) : warning 219: local variable "z" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2981) : warning 219: local variable "x" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2981) : warning 219: local variable "y" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(2981) : warning 219: local variable "z" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(3063) : warning 219: local variable "x" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(3063) : warning 219: local variable "y" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(3063) : warning 219: local variable "z" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(3090) : warning 219: local variable "x" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(3090) : warning 219: local variable "y" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(3090) : warning 219: local variable "z" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(3709) : warning 219: local variable "x" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(3749) : warning 219: local variable "x" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(375 : warning 219: local variable "x" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(3783) : warning 219: local variable "x" shadows a variable at a preceding level F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(4125) : warning 219: local variable "y" shadows a variable at a preceding level |
new Float:x,Float:y,Float:z;
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new Float:x,Float:y,Float:z;
if(newkeys & KEY_CROUCH && GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && spectatorid[playerid] != INVALID_PLAYER_ID)
{
AdvanceSpectate(playerid);
}
else if(newkeys & KEY_JUMP && GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && spectatorid[playerid] != INVALID_PLAYER_ID)
{
ReverseSpectate(playerid);
}
if(PRESSED(KEY_JUMP) && jumper[playerid] == true){
GetPlayerVelocity(playerid, x, y, z);
SetPlayerVelocity(playerid, x, y, z+ 0.3);}
return 1;
}
new Float:x1,Float:y1,Float:z1;
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_CROUCH && GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && spectatorid[playerid] != INVALID_PLAYER_ID)
{
AdvanceSpectate(playerid);
}
else if(newkeys & KEY_JUMP && GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && spectatorid[playerid] != INVALID_PLAYER_ID)
{
ReverseSpectate(playerid);
}
if(PRESSED(KEY_JUMP) && jumper[playerid] == true){
GetPlayerVelocity(playerid, x1, y1, z1);
SetPlayerVelocity(playerid, x1, y1, z1+ 0.3);}
return 1;
}
F:\GTA San Andreas\Freeroam Server\pawno\Untitled.pwn(63) : warning 201: redefinition of constant/macro (symbol "pInfo") Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning. quote] But what the f*ck is a macro? |
{ |
#define macro 345