Ich höre oft von Leuten die gerne ein LapTop System haben wollen ich hab mal schnell eins gemacht mit 2 cmds !!
Unter enum pInfo
LapTop;
pEMAIL;
Unter OnPlayerConnect(playerid)
PlayerInfo[playerid][pLapTop] = 0;
PlayerInfo[playerid][pEMAIL] = randemail;
new randemail = 10001 + random(20000);
Unter OnPlayerRegister(playerid, password[])
format(var, 32, "LapTop=%d\n",PlayerInfo[playerid][pLapTop]);fwrite(hFile, var);
Unter OnPlayerLogin(playerid, passwort[])
if( strcmp( key , "LapTop" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLapTop] = strval( val ); }
Unter OnPlayerCommandText(playerid , cmdtext[])
if (strcmp(cmd, "/EMailSuchen", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pLapTop] == 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /number [playerid/PartOfName]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, sendername, sizeof(sendername));
format(string, 256, "Name: %s, E-Mail Adresse: %d",sendername,PlayerInfo[giveplayerid][pEMAIL]);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Fehler !");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Du hast kein LapTop !");
}
}
return 1;
}
und diese 2 auch noch !!
if(strcmp(cmd, "/LapTopKaufen", true) == 0)
{
if(PlayerInfo[playerid][pLevel] >= 3)
{
if(PlayerToPoint(2 , playerid , xCoord,yCoord,zCoord))
{
if(PlayerInfo[playerid][pCash] >= 2499)
{
PlayerInfo[playerid][pLapTop] = 1;
SendClientMessage(playerid,COLOR_GREEN , "Du hast dir einen LapTop gekauft Commands stehen im /help");
GivePlayerMoney(playerid, -2500);
}
else
{
SendClientMessage(playerid,COLOR_RED," Du hast nicht genug Geld um dir einen LapTop zu kaufen !!");
}
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"Du bist nicht Level 3 , man kann einen LapTop erst ab Level 3 Kaufen");
}
}
if(strcmp(cmd, "/email", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLapTop] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Du hast keinen LapTop !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "/Email [Emailaddi] [text]");
return 1;
}
if(PlayerInfo[playerid][pEMAIL] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, " Du hast keine E-Mail Adresse...");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s verschickt eine E-Mail.", sendername);
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, "USAGE: /email [EmailAddi] [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, "E-Mail: ja xD, Sender: MOLE (xD)");
RingTone[playerid] = 20;
return 1;
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "SMS: Ein einfacher Ja hätte gereicht, Sender: MOLE (xD)");
RingTone[playerid] = 20;
return 1;
}
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pEMAIL]!= 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), "E-Mail: %s, von: %s (%d)", result,sendername,PlayerInfo[playerid][pEMAIL]);
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);
SBizzInfo[2][sbTill] += 10;
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
Mobile[playerid] = 255;
return 1;
}
}
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, " Message Delivery Failed...");
}
return 1;
}