Kamar
Умник
PHP:
else if(strcmp(cmd,"/divorce",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Pawno: Для начала авторизируйтесь!");
if(PlayerInfo[playerid][pMarried] < 1) return SendClientMessage(playerid, COLOR_WHITE, "Pawno: {F42D2D}Вы не состоите в браке!");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "Pawno:{F4BD83} /divorce [Playerid/PartOfName]");
giveplayerid = ReturnUser(tmp);
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Игрок не подключен.");
if(giveplayerid != INVALID_PLAYER_ID)
{
if (!ProxDetectorS(8.0, playerid, giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Игрок слишком далеко!");
if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_GREY, "You cannot Propose to yourself!");
new dstring[MAX_PLAYER_NAME];
new wstring[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s", giveplayer);
strmid(wstring, string, 0, strlen(string), 255);
format(string, sizeof(string), "%s", PlayerInfo[playerid][pMarriedTo]);
strmid(dstring, string, 0, strlen(string), 255);
if(strcmp(dstring ,wstring, true ) == 0 )
{
format(string, sizeof(string), "Вы развелись с %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "%s предлагает Вам развод. Введите /accept divorce, если согласны", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
DivorceOffer[giveplayerid] = playerid;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Этот игрок не женат/замужем за Вас");
return 1;
}
}
}
return 1;
}
else if(strcmp(cmd,"/propose",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Pawno: Для начала авторизируйтесь!");
if(PlayerInfo[playerid][pCash] < 100000) return SendClientMessage(playerid, COLOR_GREY, "Стоимость брака 100000$");
if(PlayerInfo[playerid][pMarried] > 0) return SendClientMessage(playerid, COLOR_GREY, "Вы уже женаты!");
if(PlayerInfo[playerid][pPhousekey] == 255) return SendClientMessage(playerid, COLOR_GREY, "У Вас нет дома.");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "Pawno:{F4BD83} /propose [Playerid/PartOfName]");
giveplayerid = ReturnUser(tmp);
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "Pawno: {F42D2D}Игрок не подключен.");
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pMarried] > 0) return SendClientMessage(playerid, COLOR_GREY, "Этот игрок уже Женат.");
if(PlayerInfo[giveplayerid][pPhousekey] != 255) return SendClientMessage(playerid, COLOR_GREY, "Этот игрок тоже имеет дом.");
if(PlayerInfo[giveplayerid][pPbiskey] != 255) return SendClientMessage(playerid, COLOR_GREY, "Этот игрок тоже имеет бизнес.");
if(PlayerInfo[playerid][pLevel] < 3 || PlayerInfo[giveplayerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_GREY, "Вам или игроку меньше 5 ур.");
if(MarryWitnessOffer[playerid] == giveplayerid || MarryWitnessOffer[giveplayerid] == playerid) return SendClientMessage(playerid, COLOR_GREY, "Вы свидетель.");
if (!ProxDetectorS(8.0, playerid, giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "Pawno: {F42D2D}Игрок слишком далеко");
if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_WHITE, "Pawno: {F42D2D}Вы не можете предложить брак себе!");
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Вы сделали предложение %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "%s предлагает Вам пожениться/выйти замуж.Введите /accept marriage, если согласны.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
ProposeOffer[giveplayerid] = playerid;
}
}
return 1;
}
else if(strcmp(cmd,"/witness",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Pawno: Для начала авторизируйтесь!");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "Pawno:{F4BD83} /witness [Playerid/PartOfName]");
giveplayerid = ReturnUser(tmp);
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Игрок не подключен.");
if(giveplayerid != INVALID_PLAYER_ID)
{
if (!ProxDetectorS(8.0, playerid, giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Этот игрок не возле Вас.");
if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_GREY, "You cannot Propose to yourself!");
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Вы предложили %s быть Вашим свидетелем брака.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "%s предлагет Вам быть его свдетелем брака. Введите /accept witness, если согласны.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
MarryWitnessOffer[giveplayerid] = playerid;
}
}
return 1;
}
Последнее редактирование модератором:
