Guten Tag liebe User des Forums.
Ich habe nun ein kleines Problem.
Ich habe hier im Server das Thema Roadblock gefunden.
Und da ich gerade einen Reallife Server mache, gleich eingefügt.
Nun ein kleines Problem:
Ich habe es eingefügt, und erhalte Warnings.
Code
C:\DOKUME~1\steve\Desktop\Neu\Reallife\TESTSE~1\GAMEMO~1\GGF.pwn(8956) : warning 219: local variable "roadblock" shadows a variable at a preceding level
C:\DOKUME~1\steve\Desktop\Neu\Reallife\TESTSE~1\GAMEMO~1\GGF.pwn(8957) : warning 219: local variable "RoadBlock" shadows a variable at a preceding level
C:\DOKUME~1\steve\Desktop\Neu\Reallife\TESTSE~1\GAMEMO~1\GGF.pwn(17693) : warning 204: symbol is assigned a value that is never used: "teamnumber"
C:\DOKUME~1\steve\Desktop\Neu\Reallife\TESTSE~1\GAMEMO~1\GGF.pwn(8957) : warning 204: symbol is assigned a value that is never used: "RoadBlock"
C:\DOKUME~1\steve\Desktop\Neu\Reallife\TESTSE~1\GAMEMO~1\GGF.pwn(8956) : warning 203: symbol is never used: "roadblock"
C:\DOKUME~1\steve\Desktop\Neu\Reallife\TESTSE~1\GAMEMO~1\GGF.pwn(28609) : warning 235: public function lacks forward declaration (symbol "OnPlayerPrivmsg")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
6 Warnings.
Alles anzeigen
So.
Und so sieht das ganze bei mir aus:
Code
//---------------------------<[ OnPlayerCommandText ]>--------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/rb", true)==0)
{
if (PlayerInfo[playerid][pMember] >= 1 && PlayerInfo[playerid][pMember] <= 3) return SendClientMessage(playerid, COLOR_RED," Du bist kein Beamter!");
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
roadblock = CreateObject(981, X, Y, Z, 0.0, 0.0, A+180);
SetPlayerPos(playerid, X, Y, Z+4);
RoadBlock[playerid] += 1;
SendClientMessage(playerid, COLOR_GREEN, "RoadBlock platziert");
return 1;
}
if(strcmp(cmdtext, "/drb", true)==0)
{
if (PlayerInfo[playerid][pMember] >= 1 && PlayerInfo[playerid][pMember] <= 3) return SendClientMessage(playerid, COLOR_RED," You're not a cop!");
if (RoadBlock[playerid] == 0) return SendClientMessage(playerid, COLOR_RED," You didn't add a roadblock!");
DestroyObject(roadblock);
RoadBlock[playerid] -= 0;
SendClientMessage(playerid, COLOR_GREEN, "RoadBlock entfernt");
return 1;
}//so in OnPlayerComandText einfügen
new roadblock;
new RoadBlock[MAX_PLAYERS];
Alles anzeigen
Natürlich steht unten drunter bei new roadblock; etc noch etwas: