Hallo Breadfish
Ich habe hir mal einen script gebastelt:
if(strcmp(cmd, "/bankautomat", true) == 0)
{
if(PlayerToPoint(2.0, playerid,1537.4069,-1648.9375,13.5469 ))
{
SendClientMessage(playerid, COLOR_RED, "Du bist nicht am Bankautomat!");
return 1;
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE,"******-----------Ban Automat Hilfe-----------******");
SendClientMessage(playerid, COLOR_GREEN,"Befehle: /bawithdraw /babank /babalance /batransfer");
SendClientMessage(playerid, COLOR_GREEN,"******----Bankautomat system by [AM]-Alex----******");
}
return 1;
}
}
Problem:
Wenn ich genau auf dem punkt bin und /bankautomat eingebe kommt: Du bist nicht am bankautomat
Binn ich irgendwo anders halt wo der punkt nicht mehr ist steht das das von oben mit tippe und so wo liegt da der feler?
Bitte helft mir
Problem Mit CMD
- alex2009
- Geschlossen
- Erledigt
-
-
Zitat
Zitat von dir:if(PlayerToPoint(2.0, playerid,1537.4069,-1648.9375,13.5469 ))
{
SendClientMessage(playerid, COLOR_RED, "Du bist nicht am Bankautomat!");
return 1;
Es ist dann ja logisch, dass die Meldung kommt^^ muss so heißen:
if(strcmp(cmd, "/bankautomat", true) == 0)
{
if(PlayerToPoint(2.0, playerid,1537.4069,-1648.9375,13.5469 )) {
SendClientMessage(playerid, COLOR_LIGHTBLUE,"******-----------Ban Automat Hilfe-----------******");
SendClientMessage(playerid, COLOR_GREEN,"Befehle: /bawithdraw /babank /babalance /batransfer");
SendClientMessage(playerid, COLOR_GREEN,"******----Bankautomat system by [AM]-Alex----******"); }
else { SendClientMessage(playerid, COLOR_RED, "Du bist nicht am Bankautomat!"); }
return 1;
} -
Kein Wunder... Du hast es so gemacht das wenn er beim Bank Automaten die Warnung kommt
if(PlayerToPoint(2.0, playerid,1537.4069,-1648.9375,13.5469 ))
{
SendClientMessage(playerid, COLOR_RED, "Du bist nicht am Bankautomat!");und wenn er weg geht Zeigt es die Info...
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE,"******-----------Ban Automat Hilfe-----------******");
SendClientMessage(playerid, COLOR_GREEN,"Befehle: /bawithdraw /babank /babalance /batransfer");
SendClientMessage(playerid, COLOR_GREEN,"******----Bankautomat system by [AM]-Alex----******");
}
return 1;
}
}MfG
-
lol beide gleichzeitg
Aber danke danke bin noch nicht so gut im scripten aber mein bankautomat funktionirt jetzt!
Edit: Leider muste ich feststellen das doch ein problem da ist undzwar das:
Also dirt ist es genau so wen ich an der stelle stehe steht du bist NICH am bankautomat gehe ich woanders hin kan ich es machen also auchwieder alles umgekert bitte helft mir dabei!
ich bin schon am kof zerbrechen wie ich das endern soll
if(strcmp(cmd, "/bankautomat", true) == 0)
{
if(PlayerToPoint(2.0, playerid,1537.4069,-1648.9375,13.5469 )) {
SendClientMessage(playerid, COLOR_LIGHTBLUE,"******-----------Ban Automat Hilfe-----------******");
SendClientMessage(playerid, COLOR_GREEN,"Befehle: /bawithdraw /babank /babalance /batransfer");
SendClientMessage(playerid, COLOR_GREEN,"******----Bankautomat system by [AM]-Alex----******"); }
else { SendClientMessage(playerid, COLOR_RED, "Du bist nicht am Bankautomat!"); }
return 1;
}
//------------------Info Ende---------------------------------
if(strcmp(cmd, "/bawithdraw", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(2.0, playerid,1537.4069,-1648.9375,13.5469 ))
{
SendClientMessage(playerid, COLOR_GREY, " Du bist nicht am Bankautomat!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /bawithdraw [amount]");
format(string, sizeof(string), " Du hast $%d in deinem Account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new cashdeposit = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /bawithdraw [amount]");
format(string, sizeof(string), " Du hast $%d in deinem Account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much !");
return 1;
}
ConsumingMoney[playerid] = 1;
PlayerMoney[playerid] += cashdeposit;
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
format(string, sizeof(string), " You Have Withdrawn $%d from your account Total: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
return 1;
}
if(strcmp(cmd, "/babank", true) == 0 || strcmp(cmd, "/deposit", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(2.0, playerid,1537.4069,-1648.9375,13.5469 ))
{
SendClientMessage(playerid, COLOR_GREY, " Du bist nicht am Bankautomat!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /babank [amount]");
format(string, sizeof(string), " Du hast $%d iin deinem Account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new cashdeposit = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /babank [amount]");
format(string, sizeof(string), " Du hast $%d in deinem Account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much");
return 1;
}
PlayerMoney[playerid] -= cashdeposit;
new curfunds = PlayerInfo[playerid][pAccount];
PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];
SendClientMessage(playerid, COLOR_WHITE, "|___ BANK STATMENT ___|");
format(string, sizeof(string), " Alter Kontostand: $%d", curfunds);
SendClientMessage(playerid, COLOR_GRAD2, string);
format(string, sizeof(string), " Deposit: $%d",cashdeposit);
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
format(string, sizeof(string), " Neuer Kontostand: $%d", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
return 1;
}
if(strcmp(cmd, "/babalance", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(2.0, playerid,1537.4069,-1648.9375,13.5469 ))
{
SendClientMessage(playerid, COLOR_GREY, " Du bist nicht am Bankautomat!");
return 1;
}
format(string, sizeof(string), " Du $%d in deinem Account.",PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 1;
}
if(strcmp(cmd, "/badice", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new dice = random(6)+1;
if (gDice[playerid] == 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s Throws a Dice that lands on %d", sendername,dice);
ProxDetector(5.0, playerid, string, TEAM_GREEN_COLOR,TEAM_GREEN_COLOR,TEAM_GREEN_COLOR,TEAM_GREEN_COLOR,TEAM_GREEN_COLOR);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " You Don't Have A Dice");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/batransfer", true) == 0 || strcmp(cmd, "/bawiretransfer", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " Du brauchst level 3 !");
return 1;
}
if(PlayerToPoint(2.0, playerid,1537.4069,-1648.9375,13.5469 ))
{
SendClientMessage(playerid, COLOR_GREY, " Du bist nicht am Bankautomat!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Benutze: /batransfer [playerid/PartOfName] [amount]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Benutze: /batransfer [playerid/PartOfName] [amount]");
return 1;
}
moneys = strval(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = PlayerInfo[playerid][pAccount] ;
if (moneys > 0 && playermoney >= moneys)
{
PlayerInfo[playerid][pAccount] -= moneys;
PlayerInfo[giveplayerid][pAccount] += moneys;
format(string, sizeof(string), " You have transferd $%d to %s's account", moneys, giveplayer,giveplayerid);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), " You have recieved $%d to into your account from %s", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
format(string, sizeof(string), "%s transferd $%d to %s", sendername, moneys, giveplayer);
if(moneys >= 500000)
{
ABroadCast(COLOR_YELLOW,string,1);
}
printf("%s", string);
PayLog(string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Invalid transaction amount.");
}
}
}
else
{
format(string, sizeof(string), " %d ist nicht im Spiel!", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
} -
if(strcmp(cmd, "/bankautomat", true) == 0)
{
if(PlayerToPoint(2.0, playerid,1537.4069,-1648.9375,13.5469 )) {
SendClientMessage(playerid, COLOR_LIGHTBLUE,"******-----------Ban Automat Hilfe-----------******");
SendClientMessage(playerid, COLOR_GREEN,"Befehle: /bawithdraw /babank /babalance /batransfer");
SendClientMessage(playerid, COLOR_GREEN,"******----Bankautomat system by [AM]-Alex----******"); }
else { SendClientMessage(playerid, COLOR_RED, "Du bist nicht am Bankautomat!"); }
return 1;
}
//------------------Info Ende---------------------------------
if(strcmp(cmd, "/bawithdraw", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!PlayerToPoint(2.0, playerid,1537.4069,-1648.9375,13.5469 ))
{
SendClientMessage(playerid, COLOR_GREY, " Du bist nicht am Bankautomat!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /bawithdraw [amount]");
format(string, sizeof(string), " Du hast $%d in deinem Account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new cashdeposit = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /bawithdraw [amount]");
format(string, sizeof(string), " Du hast $%d in deinem Account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much !");
return 1;
}
ConsumingMoney[playerid] = 1;
PlayerMoney[playerid] += cashdeposit;
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
format(string, sizeof(string), " You Have Withdrawn $%d from your account Total: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
return 1;
}
if(strcmp(cmd, "/babank", true) == 0 || strcmp(cmd, "/deposit", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!PlayerToPoint(2.0, playerid,1537.4069,-1648.9375,13.5469 ))
{
SendClientMessage(playerid, COLOR_GREY, " Du bist nicht am Bankautomat!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /babank [amount]");
format(string, sizeof(string), " Du hast $%d iin deinem Account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new cashdeposit = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /babank [amount]");
format(string, sizeof(string), " Du hast $%d in deinem Account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much");
return 1;
}
PlayerMoney[playerid] -= cashdeposit;
new curfunds = PlayerInfo[playerid][pAccount];
PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];
SendClientMessage(playerid, COLOR_WHITE, "|___ BANK STATMENT ___|");
format(string, sizeof(string), " Alter Kontostand: $%d", curfunds);
SendClientMessage(playerid, COLOR_GRAD2, string);
format(string, sizeof(string), " Deposit: $%d",cashdeposit);
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
format(string, sizeof(string), " Neuer Kontostand: $%d", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
return 1;
}
if(strcmp(cmd, "/babalance", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!PlayerToPoint(2.0, playerid,1537.4069,-1648.9375,13.5469 ))
{
SendClientMessage(playerid, COLOR_GREY, " Du bist nicht am Bankautomat!");
return 1;
}
format(string, sizeof(string), " Du $%d in deinem Account.",PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 1;
}
if(strcmp(cmd, "/badice", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new dice = random(6)+1;
if (gDice[playerid] == 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s Throws a Dice that lands on %d", sendername,dice);
ProxDetector(5.0, playerid, string, TEAM_GREEN_COLOR,TEAM_GREEN_COLOR,TEAM_GREEN_COLOR,TEAM_GREEN_COLOR,TEAM_GREEN_COLOR);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " You Don't Have A Dice");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/batransfer", true) == 0 || strcmp(cmd, "/bawiretransfer", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " Du brauchst level 3 !");
return 1;
}
if(!PlayerToPoint(2.0, playerid,1537.4069,-1648.9375,13.5469 ))
{
SendClientMessage(playerid, COLOR_GREY, " Du bist nicht am Bankautomat!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Benutze: /batransfer [playerid/PartOfName] [amount]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Benutze: /batransfer [playerid/PartOfName] [amount]");
return 1;
}
moneys = strval(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = PlayerInfo[playerid][pAccount] ;
if (moneys > 0 && playermoney >= moneys)
{
PlayerInfo[playerid][pAccount] -= moneys;
PlayerInfo[giveplayerid][pAccount] += moneys;
format(string, sizeof(string), " You have transferd $%d to %s's account", moneys, giveplayer,giveplayerid);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), " You have recieved $%d to into your account from %s", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
format(string, sizeof(string), "%s transferd $%d to %s", sendername, moneys, giveplayer);
if(moneys >= 500000)
{
ABroadCast(COLOR_YELLOW,string,1);
}
printf("%s", string);
PayLog(string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Invalid transaction amount.");
}
}
}
else
{
format(string, sizeof(string), " %d ist nicht im Spiel!", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
} -
ok danke das habe ich dan jetzt funtzt supiii