if(strcmp(cmd, "/sms", true) == 0 || strcmp(cmd, "/t", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pTot] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "Tote können nicht Reden!");
return 1;
}
if(PlayerInfo[playerid][pHandyGeld] <= 0 && PlayerInfo[playerid][pHandyVer] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Du hast nicht genug Guthaben um den Anruf zu Bezahlen.");
SendClientMessage(playerid, COLOR_GREY, " Geh zum Handyladen dort kannst du dir Prepaid Karten kaufen.");
SendClientMessage(playerid, COLOR_GREY, " Es gibt 30$, 60$, und 90$ Guthabenkarten.");
return 1;
}
if(PlayerInfo[playerid][pGangJailed] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Du kannst keinem eine SMS schreiben, während du im GangJail bist!");
return 0;
}
if(PlayerTied[playerid] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Du kannst keinem eine SMS schreiben, während du gefesselt bist!");
return 0;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /sms [Telefonnummer] [TEXT]");
return 1;
}
if(PlayerInfo[playerid][pPnumber] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "Du hast kein Handy.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
//new handyname[20];
if(PlayerInfo[playerid][pHandyID] == 7) { format(handyname, sizeof(handyname), "Google HTC Magic"); }
else if(PlayerInfo[playerid][pHandyID] == 6) { format(handyname, sizeof(handyname), "iPhone"); }
else if(PlayerInfo[playerid][pHandyID] == 5) { format(handyname, sizeof(handyname), "BlackBerry BOLD"); }
else if(PlayerInfo[playerid][pHandyID] == 4) { format(handyname, sizeof(handyname), "Motorola Q9h"); }
else if(PlayerInfo[playerid][pHandyID] == 3) { format(handyname, sizeof(handyname), "Sony Ericsson C905"); }
else if(PlayerInfo[playerid][pHandyID] == 2) { format(handyname, sizeof(handyname), "Nokia N95"); }
else if(PlayerInfo[playerid][pHandyID] == 1) { format(handyname, sizeof(handyname), "Nokia 6500"); }
else { format(handyname, sizeof(handyname), "Nokia 3330"); }
format(string, sizeof(string), "* %s nimmt sein %s raus.", sendername, handyname);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new phonenumb = strval(tmp);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /sms [Telefonnummer] [TEXT]");
return 1;
}
if(phonenumb == 555)
{
if ((strcmp("ja", result, true, strlen(result)) == 0) && (strlen(result) == strlen("ja")))
{
SendClientMessage(playerid, COLOR_WHITE, "Gesendet.");
if (gTeam[playerid] == 2 || gTeam[playerid] == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, "SMS: Worüber redest du, Sender: MOLE (555)");
RingTone[playerid] = 20;
return 1;
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "SMS: Sag einfach ja, Sender: MOLE (555)");
RingTone[playerid] = 20;
return 1;
}
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
{
giveplayerid = i;
Mobile[playerid] = giveplayerid; //caller connecting
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PhoneOnline[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "Dieser Spieler ist Offline !");
return 1;
}
format(string, sizeof(string), "SMS: %s, von: %s (%d)", result,sendername,PlayerInfo[playerid][pPnumber]);
GetPlayerName(giveplayerid, sendername, sizeof(sendername));
//format(string, sizeof(string), "* %s's phone beeps.", sendername);
RingTone[giveplayerid] =20;
SendClientMessage(playerid, COLOR_WHITE, "Gesendet");
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "~r~$-%d", txtcost);
GameTextForPlayer(playerid, string, 5000, 1);
//PlayerInfo[playerid][pHandyGeld] -= txtcost;
if(PlayerInfo[playerid][pHandyVer] == 0) PlayerInfo[playerid][pHandyGeld] -= 1;
SBizzInfo[1][sbTill] += 10;
ExtortionSBiz(1, txtcost);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
Mobile[playerid] = 255;
return 1;
}
}
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, "Senden Fehlgeschlagen");
}
return 1;
}
Wie baue ich hier die Funktion ein das die SMS im einen Seperaten Log gespeichert werden?
Gruß Fahne