//So hier Teil 2 der /edit befehl und was ich zulätzt verändert hab...
if(strcmp(cmd, "/edit", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 4)
{
SendClientMessage(playerid, COLOR_GRAD2, "Du bist kein Admin!");
return 1;
}
new x_job[256];
x_job = strtok(cmdtext, idx);
if(!strlen(x_job)) {
SendClientMessage(playerid, COLOR_WHITE, "|__________________ Edit __________________|");
SendClientMessage(playerid, COLOR_WHITE, "Verwendung: /edit [name] betrag] (für Hauser und Unternehmen)");
SendClientMessage(playerid, COLOR_GREY, "Verfügbare Namen: Level, Price, Funds, Products");
SendClientMessage(playerid, COLOR_WHITE, "|____________________________________________|");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Verwendung: /edit [name] [betrag]");
return 1;
}
new proplev = strval(tmp);
//if(strcmp(x_job,"car",true) == 0)
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
{
format(string, sizeof(string), "Haus: %d", i);
SendClientMessage(playerid, COLOR_GRAD2, string);
if(proplev > 0)
{
if(strcmp(x_job,"level",true) == 0)
{
HouseInfo[i][hLevel] = proplev;
}
else if(strcmp(x_job,"price",true) == 0)
{
HouseInfo[i][hValue] = proplev;
}
}
}
}
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
{
format(string, sizeof(string), "Biz: %d", i);
SendClientMessage(playerid, COLOR_GRAD2, string);
if(proplev > 0)
{
if(strcmp(x_job,"level",true) == 0)
{
BizzInfo[i][bLevelNeeded] = proplev;
}
else if(strcmp(x_job,"price",true) == 0)
{
BizzInfo[i][bBuyPrice] = proplev;
}
else if(strcmp(x_job,"funds",true) == 0)
{
BizzInfo[i][bTill] = proplev;
}
else if(strcmp(x_job,"products",true) == 0)
{
BizzInfo[i][bProducts] = proplev;
}
}
}
}
for(new i = 0; i < sizeof(SBizzInfo); i++)
{
if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
{
format(string, sizeof(string), "SBiz: %d", i);
SendClientMessage(playerid, COLOR_GRAD2, string);
if(proplev > 0)
{
if(strcmp(x_job,"level",true) == 0)
{
SBizzInfo[i][sbLevelNeeded] = proplev;
}
else if(strcmp(x_job,"price",true) == 0)
{
SBizzInfo[i][sbBuyPrice] = proplev;
}
else if(strcmp(x_job,"funds",true) == 0)
{
SBizzInfo[i][sbTill] = proplev;
}
else if(strcmp(x_job,"products",true) == 0)
{
SBizzInfo[i][sbProducts] = proplev;
}
}
}
}
format(string, sizeof(string), "Du hast bereinigt: %s.", x_job);
SendClientMessage(playerid, COLOR_WHITE, string);
OnPropUpdate();
}
return 1;
}
Zuletzt verändert:
Unter OnPlayerText
if(RegistrationStep[playerid] > 0)
{
/* if(RegistrationStep[playerid] == 1)
{
new idx;
tmp = strtok(text, idx);
if((strcmp("männlich", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("männlich")))
{
PlayerInfo[playerid][pSex] = 1;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ok, du bist also männlich.");
SendClientMessage(playerid, COLOR_WHITE, "Wann ist dein Geburtstag? (Benutze zb. 25.11.1998)");
RegistrationStep[playerid] = 2;
return 0;
}
else if((strcmp("weiblich", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("weiblich")))
{
PlayerInfo[playerid][pSex] = 2;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ok, du bist also weiblich.");
SendClientMessage(playerid, COLOR_WHITE, "Wann ist dein Geburtstag? (Benutze zb. 25.11.1998)");
RegistrationStep[playerid] = 2;
return 0;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Bist du männlich oder weiblich? (Gib ein was du bist!).");
}
return 0;
}*/
if(RegistrationStep[playerid] == 1)
{
ShowMenuForPlayer(abfrage, playerid);
return 0;
}
if(RegistrationStep[playerid] == 2)
{
new year, month,day;
getdate(year, month, day);
new DateInfo[3][20];
split(text, DateInfo, '.');
if (!IsValidDate(strval(DateInfo[0]),strval(DateInfo[1]),strval(DateInfo[2]))) {
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Wann ist dein Geburtstag? (Benutze zb. 25.11.1998)");
return 0;
}
if(year - strval(DateInfo[2]) > 100 || strval(DateInfo[2]) < 1 || strval(DateInfo[2]) >= year)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Wann ist dein Geburtstag? (Benutze zb. 25.11.1998)");
return 0;
}
new check = year - strval(DateInfo[2]);
if(check == year)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Wann ist dein Geburtstag? (Benutze zb. 25.11.1998)");
return 0;
}
if(strval(DateInfo[1]) > month)
{
check -= 1;
}
else if(strval(DateInfo[1]) == month && strval(DateInfo[0]) > day)
{
check -= 1;
}
PlayerInfo[playerid][pAge] = check;
format(string, sizeof(string), "Ok, du bist also %d Jahre alt.",PlayerInfo[playerid][pAge]);
SendClientMessage(playerid, COLOR_WHITE, string);
RegistrationStep[playerid] = 3;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Woher kommst du? Wähle aus:");
RegistrationStep[playerid] = 3;
ShowMenuForPlayer(herkunft, playerid);
return 0;
}
/* else if(RegistrationStep[playerid] == 3)
{
new idx;
tmp = strtok(text, idx);
if((strcmp("usa", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("usa")))
{
PlayerInfo[playerid][pOrigin] = 1;
SendClientMessage(playerid, COLOR_WHITE, "Ok, du kommst also von den USA.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Danke für deine Informationen. Du wirst zum Tutorial weitergeleitet.");
ShowMenuForPlayer(geschenk, playerid);
RegistrationStep[playerid] = 0;
TutTime[playerid] = 1;
return 0;
}
else if((strcmp("europa", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("europe")))
{
PlayerInfo[playerid][pOrigin] = 2;
SendClientMessage(playerid, COLOR_WHITE, "Ok, du kommst also aus Europa.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Danke für deine Informationen. Du wirst zum Tutorial weitergeleitet.");
ShowMenuForPlayer(geschenk, playerid);
RegistrationStep[playerid] = 0;
TutTime[playerid] = 1;
return 0;
}
else if((strcmp("asia", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("asia")))
{
PlayerInfo[playerid][pOrigin] = 3;
SendClientMessage(playerid, COLOR_WHITE, "Ok, du kommst also aus Asien.");
ShowMenuForPlayer(geschenk, playerid);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Danke für deine Informationen. Du wirst zum Tutorial weitergeleitet.");
RegistrationStep[playerid] = 0;
TutTime[playerid] = 1;
return 0;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Woher kommst du? (Schreibe: USA, Europa oder Asien)");
}*/
//return 0;
//}
/*if(RegistrationStep[playerid] == 3)
{
ShowMenuForPlayer(herkunft, playerid);
return 0;
}*/
return 0;
}
Hoffe mir kann einer helfen 