hi,
könnte mir mal jemand ein Filterscript machen für denn /roadblock befehl ??
oder mir zeigen wo ich das hir einfügen muss ??
http://forum.sa-mp.com/index.php?topic=42820.0
MFG
JoJu_RED
hi,
könnte mir mal jemand ein Filterscript machen für denn /roadblock befehl ??
oder mir zeigen wo ich das hir einfügen muss ??
http://forum.sa-mp.com/index.php?topic=42820.0
MFG
JoJu_RED
das untere haust du bei OnPlayerCommandText rein und das oberste versuch das ma bei OnGameModeInit, wenn es nciht klappen sollte dann mit in den script bei OnPlayerCommandText
wenn beides end geht dann kA, glaub aber, dass mindestens 1 geht xD
Alsöö....
new roadblock; // Unter includes
new RoadBlock[MAX_PLAYERS]; // Unter includes
public OnPlayerCommandText(playerid,cmdtext [])
{
if(strcmp(cmdtext, "/rb", true)==0)
{
if (gTeam[playerid] != TEAM_BLUE) return SendClientMessage(playerid, COLOR_RED," You're not a cop!");
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 Successfully Deployed");
return 1;
}
if(strcmp(cmdtext, "/drb", true)==0)
{
if (gTeam[playerid] != TEAM_BLUE) 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 Successfully Removed");
return 1;
}
return 0;
} //so in OnPlayerComandText einfügen
xD ich krig das net hin könnte mir mal jemand zeigen wo genau ich das bei
public OnPlayerCommandText(playerid,cmdtext []) einfügen muss.
also könnte mir das mal abendern sodas ich das nurnoch ersetzen muss!?
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new playermoney;
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];
new cmd[256];
new tmp[256];
new giveplayerid, moneys, idx;
cmd = strtok(cmdtext, idx);
if (!strcmp("/kill", cmdtext, true))
{
SetPlayerHealth(playerid, 0.0);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new playermoney;
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];
new cmd[256];
new tmp[256];
new giveplayerid, moneys, idx;
cmd = strtok(cmdtext, idx);
if (!strcmp("/kill", cmdtext, true))
{
SetPlayerHealth(playerid, 0.0);
return 1;
}
if(strcmp(cmdtext, "/rb", true)==0)
{
if (gTeam[playerid] != TEAM_BLUE) return SendClientMessage(playerid, COLOR_RED," You're not a cop!");
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 Successfully Deployed");
return 1;
}
if(strcmp(cmdtext, "/drb", true)==0)
{
if (gTeam[playerid] != TEAM_BLUE) 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 Successfully Removed");
return 1;
}
return 0;
}
Du musst doch nur lesen was da steht ich habe das ohne probleme hin bekommen
Hab das jetzt so eingefügt
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new playermoney;
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];
new cmd[256];
new tmp[256];
new giveplayerid, moneys, idx;
cmd = strtok(cmdtext, idx);
if (!strcmp("/kill", cmdtext, true))
{
SetPlayerHealth(playerid, 0.0);
return 1;
}
if(strcmp(cmdtext, "/rb", true)==0)
{
if (gTeam[playerid] != TEAM_BLUE) return SendClientMessage(playerid, COLOR_RED," You're not a cop!");
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 Successfully Deployed");
return 1;
}
if(strcmp(cmdtext, "/drb", true)==0)
{
if (gTeam[playerid] != TEAM_BLUE) 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 Successfully Removed");
return 1;
}
aber bekomme Dise Fehlermeldung!
C:\Users\John\Desktop\Lee's test server package\gamemodes\stagethreerp.pwn(9506) : warning 217: loose indentation
1 Warning.
Was hab ich denn falsch gemacht ?
und die anderen beiden sachen hab ich hir eingefügt
forward OnPlayerRename (name[],string[],playerid);
forward ClearChatbox(playerid, lines);
//------------------------------------------------------------------------------------------------------
new roadblock; // <-- HIER
new RoadBlock[MAX_PLAYERS]; // <-- HIER
new Gate;
// new License;
new Security = 0;
new CreatedCars[100];
new CreatedCar = 0;
new Tax = 0;
JO, genau richtig! Aber die PWN-klammer tun den Code manchmal bisschen vershcieben(loose indetation: flasch eingerückt)
Hier als .pwn-file breadfish.de/wcf/attachment/157/