CMD:spawn(playerid, params[]){ if(GetPVarInt(playerid,\"haz_spawn\") == 0) return SetPVarInt(playerid, \"haz_spawn\", 1), SCM(playerid, COLOR_LORANGE, \"Ház spawn bekapcsolva.\"); if(GetPVarInt(playerid,\"haz_spawn\") == 1) return SetPVarInt(playerid, \"haz_spawn\", 0), SCM(playerid, COLOR_GREY, \"Ház spawn kikapcsolva.\"); return 1;}public OnPlayerSpawn(playerid){ new hazacska = MelyikHaz(playerid); if(hazacska) { if(GetPVarInt(playerid,\"haz_spawn\") == 1) { SetPlayerPos(playerid, hInfo[hazacska][kX], hInfo[hazacska][kY], hInfo[hazacska][kZ]); SetPlayerInterior(playerid, hInfo[hazacska][interior]); SetPlayerVirtualWorld(playerid, hInfo[hazacska][iD]); hazban[playerid] = 1; mhazban[playerid] = hInfo[hazacska][iD]; kx[playerid] = hInfo[hazacska][X]; ky[playerid] = hInfo[hazacska][Y]; kz[playerid] = hInfo[hazacska][Z]; } } return 1;}
stock MelyikHaz(playerid){ for(new i;i<MAX_HOUSES;i++) { if(IsPlayerInRangeOfPoint(playerid, 1.0, hInfo[X], hInfo[Y], hInfo[Z])) return i; } return -1;}
CMD:spawn(playerid, params[]){new hid, nme[MAX_PLAYER_NAME];GetPlayerName(playerid, nme, sizeof(nme));if(sscanf(params, \"d\", hid)) return SCM(playerid, -1, \"Használat: /spawn [ház ID], kikapcsoláshoz /spawn -1\");if(!strcmp(hInfo[hid][Owner], nme, true)){ if(hid != -1){ SetPVarInt(playerid, \"haz_spawn\", hid); SCM(playerid, COLOR_LORANGE, \"Ház spawn bekapcsolva.\");} else{ SetPVarInt(playerid, \"haz_spawn\", -1); SCM(playerid, COLOR_GREY, \"Ház spawn kikapcsolva.\");}}else return SCM(playerid, -1, \"Ez a ház nem a tiéd!\");return 1;}
if(GetPVarInt(playerid, \"haz_spawn\") > -1){ new hid = GetPVarInt(playerid, \"haz_spawn\"); SetPlayerPos(playerid, hInfo[hid][kX], hInfo[hid][kY], hInfo[hid][kZ]); SetPlayerInterior(playerid, hInfo[hid][interior]);SetPlayerVirtualWorld(playerid, hInfo[hid][iD]); hazban[playerid] = 1;mhazban[playerid] = hInfo[hid][iD]; kx[playerid] = hInfo[hid][X];ky[playerid] = hInfo[hid][Y];kz[playerid] = hInfo[hid][Z];}
CMD:spawn(playerid, params[]){ new hid, id; if(sscanf(params, \"d\", hid)) return SCM(playerid, COLOR_GREY, \"Használat: /spawn [ház ID], kikapcsoláshoz /spawn 0\"); hInfo[id][iD] = hid; if(hid == 0) return SetPVarInt(playerid, \"haz_spawn\", 0), SCM(playerid, COLOR_GREY, \"Ház spawn kikapcsolva.\"); if(id == hInfo[hid][Owner]) { SCM(playerid, COLOR_RED, \"Ez a ház nem a tiéd!\"); } else { SetPVarInt(playerid, \"haz_spawn\", hid), SCM(playerid, COLOR_LORANGE, \"Ház spawn bekapcsolva.\"); } return 1;}