Код:
CMD:block(playerid, params[])
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pPhone] == 1)
{
new id,string[128],string2[128],name[30];
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_USAGE, "Usage:{FFFFFF} /block [name/playerid]");
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][pPhoneBlocked][id] == 1) return SS(playerid, COLOR_LGREEN, "Acest user este deja blocat.", "That user is already blocked.");
PlayerInfo[playerid][pPhoneBlocked][id] = 1;
GetPlayerName(id, name, sizeof(name));
format(string, sizeof(string), "Userul %s a fost blocat. Nu te va putea contacta prin telefon pana la urmatorul relog.", name);
format(string2, sizeof(string2), "User %s has been temporary blocked. He won't be able to call/sms you until you reconnect to the server.", name);
SS(playerid, COLOR_NICE, string, string2);
}
else return SendClientMessage(playerid, COLOR_GREY, "Player not connected.");
}
else return SendClientMessage(playerid, COLOR_WHITE, "You don't have an iPhone.");
}
return 1;
}
CMD:unblock(playerid, params[])
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pPhone] == 1) // LINE 35215
{
new id,string[128],string2[128],name[30];
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_USAGE, "Usage:{FFFFFF} /unblock [name/playerid]");
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][pPhoneBlocked][id] == 0) return SS(playerid, COLOR_LGREEN, "Acest user nu este blocat.", "That user is not blocked!");
PlayerInfo[playerid][pPhoneBlocked][id] = 0;
GetPlayerName(id, name, sizeof(name));
format(string, sizeof(string), "Userul %s a fost deblocat.", name);
format(string2, sizeof(string2), "User %s has been unblocked.", name);
SS(playerid, COLOR_NICE, string, string2);
}
else return SendClientMessage(playerid, COLOR_GREY, "Player not connected.");
}
else return SendClientMessage(playerid, COLOR_WHITE, "You don't have an iPhone.");
}
return 1;
}
CMD:call(playerid, params[])
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
if(IsPlayerConnected(playerid))
{
new number,sendername[30],string[256],giveplayer[25];
if(sscanf(params, "i",number)) return SendClientMessage(playerid, COLOR_USAGE, "Usage:{FFFFFF} /call [number]");
if(PlayerInfo[playerid][pPnumber] == 0) return SendClientMessage(playerid, COLOR_WHITE, "You don't have a phone.");
if(PhoneOnline[playerid] > 0) return SCM(playerid, COLOR_WHITE, "You must switch your phone on first (/turn on).");
if(PlayerInfo[playerid][pCredits] < 2) return SCM(playerid, COLOR_GREY, "You have no remaining phone credit - visit a 24/7 to top it up.");
if(PlayerInfo[playerid][pSleeping] == 1) return SendClientMessage(playerid, COLOR_GRAD1, "You are sleeping.");
GetPlayerName(playerid, sendername, sizeof(sendername));
if(number == 112 || number == 911)
{
if(IsACop(playerid) && OnDuty[playerid] == 1) return SCM(playerid,COLOR_LGREEN,"You are a on duty cop.");
if(WantedReason[playerid] != -1)
{
if(!IsPlayerConnected(WantedName[playerid]) || !gPlayerLogged[playerid]) return SCM(playerid, -1, "You can't report the last crime did on you anymore.");
if(PlayerInfo[WantedName[playerid]][pJailed] > 0) return SCM(playerid, COLOR_WHITE, "This player is already in jail.");
new killerid = WantedName[playerid];
SCM(playerid, COLOR_GENANNOUNCE, "This player has wanted now. Thank you for reporting the crime.");
if(WantedReason[playerid] == 0) addWantedPlayer(killerid, playerid, 1, "first degree murder");
else if(WantedReason[playerid] == 1) addWantedPlayer(killerid, playerid, 1, "hit and run");
addToAchievements(killerid, 31);
ClearWanted(playerid);
return 1;
}
else
{
if(Mobile[playerid] == -1)
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
Mobile[playerid] = -2;
SendClientMessage(playerid, COLOR_WHITE, "You've called Emergency services, please select the department you desire (i.e: SFPD, LSFMD).");
if(PlayerInfo[playerid][pPhone] == 0)
{
SetPlayerAttachedObject(playerid,4,330,6, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
}
else if(PlayerInfo[playerid][pPhone] == 1)
{
SetPlayerAttachedObject(playerid, 4, 18865, 6, 0.086043, 0.027719, 0.003817, 95.232246, 178.651031, 1.691840, 1.002077, 1.000000, 1.000000 ); // MobilePhone1 - phone1
}
}
return 1;
}
}
if(number == PlayerInfo[playerid][pPnumber]) return SendClientMessage(playerid, COLOR_GRAD2, "You can't call yourself.");
if(Mobile[playerid] != -1) return SendClientMessage(playerid, COLOR_WHITE, "You are currently in a call.");
foreach(new i : Player)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pPnumber] == number && number != 0)
{
new giveplayerid = i;
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PhoneOnline[giveplayerid] > 0) return SendClientMessage(playerid, COLOR_WHITE, "That player phone is offline.");
if(PhoneOnlineCalls[giveplayerid] > 0) return SendClientMessage(playerid, COLOR_WHITE, "That player phone is offline for calls.");
if(PlayerInfo[giveplayerid][pPhoneBlocked][playerid] == 1) return SS(playerid, COLOR_LGREEN, "Playerul pe care incerci sa-l suni ti-a blocat numarul de telefon.", "The player you are trying to call has blocked your number. You can't contact him/her.");
if (Mobile[giveplayerid] == -1)
{
Mobile[playerid] = giveplayerid;
if(PlayerInfo[playerid][pPhone] == 0)
{
format(string, sizeof(string), "* %s takes out their cellphone, and dials in a number.", sendername);
}
else if(PlayerInfo[playerid][pPhone] == 1)
{
format(string, sizeof(string), "* %s takes out their iPhone, and dials in a number.", sendername);
}
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
PlayerPlaySound(playerid, 3600, 0.0, 0.0, 0.0);
PlayerPlaySound(giveplayerid, 20600, 0.0, 0.0, 0.0);
format(string, sizeof(string), "%s is calling you. Use /p(ickup) to answer your phone.", sendername);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer));
if(PlayerInfo[playerid][pPhone] == 0)
{
SetPlayerAttachedObject(playerid,4,330,6, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
}
else if(PlayerInfo[playerid][pPhone] == 1)
{
SetPlayerAttachedObject( playerid, 4, 18865, 6, 0.086043, 0.027719, 0.003817, 95.232246, 178.651031, 1.691840, 1.002077, 1.000000, 1.000000 ); // MobilePhone1 - phone1
}
if(PlayerInfo[giveplayerid][pPhone] == 0)
{
format(string, sizeof(string), "* %s's cellphone starts to ring...", giveplayer);
}
else if(PlayerInfo[giveplayerid][pPhone] == 1)
{
format(string, sizeof(string), "* %s's iPhone starts to ring...", giveplayer);
}
if(Spectate[giveplayerid] == -1) ProxDetector(20.0, giveplayerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
CellTime[playerid] = 1;
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
return 1;
}
}
}
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, "(cellphone) *busy tone*");
}
return 1;
}
YCMD:sms(playerid, params[], help)
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
if(IsPlayerConnected(playerid))
{
new phonenumb,smstext[90],sendername[30],giveplayer[30],string[256],string2[184];
if(PlayerInfo[playerid][pMuted] == 1)
{
if(PlayerInfo[playerid][pLanguage] == 2) format(string, sizeof(string), "Nu poti scrie pe chat momentan(mute). Vei putea scrie pe chat peste %d secunde.",PlayerInfo[playerid][pMuteTime]);
else format(string, sizeof(string), "You are now muted! You will be able to talk again in %d seconds.",PlayerInfo[playerid][pMuteTime]);
SendClientMessage(playerid, COLOR_NICE, string);
return 1;
}
if(sscanf(params, "is[90]",phonenumb,smstext)) return SendClientMessage(playerid, COLOR_USAGE, "Usage:{FFFFFF} /sms [number] [text]");
if(PlayerInfo[playerid][pPnumber] == 0) return SendClientMessage(playerid, COLOR_GREY, "You dont't have a phone.");
if(PhoneOnline[playerid] > 0) return SCM(playerid, COLOR_GREY, "Your phone is not switched on.");
if(PlayerInfo[playerid][pCredits] < 2) return SCM(playerid, COLOR_GREY, "You have no remaining phone credit - visit a 24/7 to top it up.");
if(phonenumb == PlayerInfo[playerid][pPnumber]) return SCM(playerid, -1, "Nu-ti poti trimite SMS singur!");
foreach(new i : Player)
{
if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
{
if(PhoneOnline[i] > 0) return SendClientMessage(playerid, COLOR_GREY, "The cellphone that you're trying to SMS is currently unavailable.");
if(PlayerInfo[i][pPhoneBlocked][playerid] == 1) return SS(playerid, COLOR_LGREEN, "Playerul caruia incerci sa ii trimiti SMS ti-a blocat numarul de telefon.", "The player you are trying to text has blocked your number. You can't contact him/her.");
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[i][pAdmin] < 1) format(string, sizeof(string), "SMS from %s (%d): %s", sendername, PlayerInfo[playerid][pPnumber], smstext);
else format(string, sizeof(string), "SMS from %s (%d): %s", sendername, playerid, smstext);
GetPlayerName(i, giveplayer, sizeof(giveplayer));
format(string2, sizeof(string2), "SMS sent to %s (%d): %s", giveplayer, PlayerInfo[i][pPnumber], smstext);
SendClientMessage(i,COLOR_YELLOW, string);
SendClientMessage(playerid,COLOR_CYAN, string2);
new var100[300],resulttt[300],strr[300];
format(strr, sizeof(strr),"[SMS] %s to %s: %s", sendername, giveplayer, smstext);
mysql_real_escape_string(strr, resulttt);
mysql_format(SQL,var100, sizeof(var100), "INSERT INTO chat_logs (`playerid`,`text`,`where`) VALUES ('%d','%s','sms')", PlayerInfo[playerid][pSQLID], resulttt);
mysql_tquery(SQL,var100,"","");
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerPlaySound(i, 1139, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pCredits] = PlayerInfo[playerid][pCredits] - 2;
LastPlayer[i] = playerid;
foreach(new adm : Admins)
{
if(BigEar[adm] == 1)
{
format(string, sizeof(string), "{63969C}SMS from %s (%d) to %s (%d): %s",sendername,playerid,giveplayer,i,smstext);
SendClientMessage(adm, COLOR_WHITE, string);
}
}
return 1;
}
}
SendClientMessage(playerid, COLOR_GREY, "Invalid number.");
}
return 1;
}