pLaptop
pLaptopOn
if(strcmp(cmd, "/laptop on", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[pLaptop] == 1) || if(PlayerInfo[pLaptop] == 2) { if(PlayerInfo[playerid][pLaptopOn] == "Off") { GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* %s flips open his Laptop and turns it on.", sendername); ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); PlayerInfo[playerid][pLaptopOn] == "On") SendClientMessage(playerid, COLOR_WHITE, "COMPUTER: Welcome"); SendClientMessage(playerid, COLOR_LIGHTBLUE, "What Would you like to do?"); SendClientMessage(playerid, COLOR_GRAD1, "| 1: Internet"); SendClientMessage(playerid, COLOR_GRAD1, "| 2: Write Note"); SendClientMessage(playerid, COLOR_GRAD2, "| 3: OnLine AD"); SendClientMessage(playerid, COLOR_GRAD3, "| 4: SHIM Messenger"); SendClientMessage(playerid, COLOR_GRAD3, "| 5: SHIM E-Mail"); else { SendClientMessage(playerid, COLOR_LIGHTBLUE, " Your laptop is already running!"); return 1; } } } return 1; }
SendClientMessage(playerid, COLOR_GRAD4, "| 15: IDN Laptop");
else if (item == 15 && GetPlayerMoney(playerid) > 999) { if(PlayerInfo[playerid][pLaptop] = 0) { SafeGivePlayerMoney(playerid, - 1000); PlayerInfo[playerid][pLaptop] = "IDN"; PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); format(string, sizeof(string), "~r~-$%d", 5); GameTextForPlayer(playerid, string, 5000, 1); SendClientMessage(playerid, COLOR_GRAD4, "You bought a IDN Laptop!"); SendClientMessage(playerid, COLOR_GRAD4, "HINT: Use '/laptop on' to turn it on!"); OnPlayerUpdate(playerid); return 1; } } } return 1; }
public OnPlayerConnect(playerid)
PlayerInfo[playerid][pLaptop] = 0; PlayerInfo[playerid][pLaptopOn] = 0;
public ShowStats(playerid,targetid)
new lrank[20]; if(PlayerInfo[targetid][pLaptop] == 1) { lrank = "IDN"; } else if(PlayerInfo[targetid][pLaptop] >= 2) { lrank = "Dlee"; } else { lrank = "None"; }
public OnPlayerRegister(playerid, password[])
format(var, 64, "Laptop=%d\n",PlayerInfo[playerid][pLaptop]);fwrite(hFile, var); format(var, 64, "LaptopOn=%d\n",PlayerInfo[playerid][pLaptopOn]);fwrite(hFile, var);
public OnPlayerLogin(playerid,password[])
if( strcmp( key , "Laptop" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLaptop] = strval( val ); } if( strcmp( key , "LaptopOn" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLaptopOn] = strval( val ); }
Originally Posted by Joel_Krantz
its not actually "internet"
|